#include <sparse_ops.h>
Converts a sparse representation into a dense tensor.
Builds an array dense
with shape output_shape
such that
```prettyprint If sparse_indices is scalar
dense[i] = (i == sparse_indices ? sparse_values : default_value)
If sparse_indices is a vector, then for each i
dense[sparse_indices[i]] = sparse_values[i]
If sparse_indices is an n by d matrix, then for each i in [0, n)
dense[sparse_indices[i][0], ..., sparse_indices[i][d-1]] = sparse_values[i] ```
All other values in dense
are set to default_value
. If sparse_values
is a scalar, all sparse indices are set to this single value.
Indices should be sorted in lexicographic order, and indices must not contain any repeats. If validate_indices
is true, these properties are checked during execution.
Arguments:
sparse_indices[i]
contains the complete index where sparse_values[i]
will be placed.sparse_indices
, or a scalar value to be used for all sparse indices.sparse_indices
.Optional attributes (see Attrs
):
Returns:
Output
: Dense output tensor of shape output_shape
. Constructors and Destructors | |
---|---|
SparseToDense(const ::tensorflow::Scope & scope, ::tensorflow::Input sparse_indices, ::tensorflow::Input output_shape, ::tensorflow::Input sparse_values, ::tensorflow::Input default_value) | |
SparseToDense(const ::tensorflow::Scope & scope, ::tensorflow::Input sparse_indices, ::tensorflow::Input output_shape, ::tensorflow::Input sparse_values, ::tensorflow::Input default_value, const SparseToDense::Attrs & attrs) |
Public attributes | |
---|---|
dense |
Public functions | |
---|---|
node() const | ::tensorflow::Node * |
operator::tensorflow::Input() const | |
operator::tensorflow::Output() const |
Public static functions | |
---|---|
ValidateIndices(bool x) |
Structs | |
---|---|
tensorflow::ops::SparseToDense::Attrs | Optional attribute setters for SparseToDense. |
::tensorflow::Output dense
SparseToDense( const ::tensorflow::Scope & scope, ::tensorflow::Input sparse_indices, ::tensorflow::Input output_shape, ::tensorflow::Input sparse_values, ::tensorflow::Input default_value )
SparseToDense( const ::tensorflow::Scope & scope, ::tensorflow::Input sparse_indices, ::tensorflow::Input output_shape, ::tensorflow::Input sparse_values, ::tensorflow::Input default_value, const SparseToDense::Attrs & attrs )
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output() const
Attrs ValidateIndices( bool x )
© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/sparse-to-dense.html