#include <sparse_ops.h>
Reorders a SparseTensor into the canonical, row-major ordering.
Note that by convention, all sparse ops preserve the canonical ordering along increasing dimension number. The only time ordering can be violated is during manual manipulation of the indices and values vectors to add entries.
Reordering does not affect the shape of the SparseTensor.
If the tensor has rank R
and N
non-empty values, input_indices
has shape [N, R]
, input_values has length N
, and input_shape has length R
.
Arguments:
N x R
matrix with the indices of non-empty values in a SparseTensor, possibly not in canonical ordering.N
non-empty values corresponding to input_indices
.Returns:
Output
output_indices: 2-D. N x R
matrix with the same indices as input_indices, but in canonical row-major ordering.Output
output_values: 1-D. N
non-empty values corresponding to output_indices
. Constructors and Destructors | |
---|---|
SparseReorder(const ::tensorflow::Scope & scope, ::tensorflow::Input input_indices, ::tensorflow::Input input_values, ::tensorflow::Input input_shape) |
Public attributes | |
---|---|
output_indices | |
output_values |
::tensorflow::Output output_indices
::tensorflow::Output output_values
SparseReorder( const ::tensorflow::Scope & scope, ::tensorflow::Input input_indices, ::tensorflow::Input input_values, ::tensorflow::Input input_shape )
© 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-reorder.html