Reshapes a SparseTensor to represent values in a new dense shape.
This operation has the same semantics as reshape on the represented dense tensor. The
input_indices are recomputed based on the requested
If one component of
new_shape is the special value -1, the size of that dimension is computed so that the total dense size remains constant. At most one component of
new_shape can be -1. The number of dense elements implied by
new_shape must be the same as the number of dense elements originally implied by
Reshaping does not affect the order of values in the SparseTensor.
If the input tensor has rank
N non-empty values, and
new_shape has length
input_indices has shape
input_shape has length
output_indices has shape
[N, R_out], and
output_shape has length
- scope: A Scope object
- input_indices: 2-D.
N x R_inmatrix with the indices of non-empty values in a SparseTensor.
- input_shape: 1-D.
R_invector with the input SparseTensor's dense shape.
- new_shape: 1-D.
R_outvector with the requested new dense shape.
N x R_outmatrix with the updated indices of non-empty values in the output SparseTensor.
R_outvector with the full dense shape of the output SparseTensor. This is the same as
new_shapebut with any -1 dimensions filled in.
Constructors and Destructors
SparseReshape( const ::tensorflow::Scope & scope, ::tensorflow::Input input_indices, ::tensorflow::Input input_shape, ::tensorflow::Input new_shape )