W3cubDocs

/TensorFlow 2.4

tf.raw_ops.SparseReorder

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.

Args
input_indices A Tensor of type int64. 2-D. N x R matrix with the indices of non-empty values in a SparseTensor, possibly not in canonical ordering.
input_values A Tensor. 1-D. N non-empty values corresponding to input_indices.
input_shape A Tensor of type int64. 1-D. Shape of the input SparseTensor.
name A name for the operation (optional).
Returns
A tuple of Tensor objects (output_indices, output_values).
output_indices A Tensor of type int64.
output_values A Tensor. Has the same type as input_values.

© 2020 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/versions/r2.4/api_docs/python/tf/raw_ops/SparseReorder