tf.raw_ops.SparseReshape
Stay organized with collections
Save and categorize content based on your preferences.
Reshapes a SparseTensor to represent values in a new dense shape.
tf.raw_ops.SparseReshape(
input_indices, input_shape, new_shape, name=None
)
This operation has the same semantics as reshape on the represented dense
tensor. The input_indices
are recomputed based on the requested new_shape
.
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 input_shape
.
Reshaping does not affect the order of values in the SparseTensor.
If the input tensor has rank R_in
and N
non-empty values, and new_shape
has length R_out
, then input_indices
has shape [N, R_in]
,
input_shape
has length R_in
, output_indices
has shape [N, R_out]
, and
output_shape
has length R_out
.
Args |
input_indices
|
A Tensor of type int64 .
2-D. N x R_in matrix with the indices of non-empty values in a
SparseTensor.
|
input_shape
|
A Tensor of type int64 .
1-D. R_in vector with the input SparseTensor's dense shape.
|
new_shape
|
A Tensor of type int64 .
1-D. R_out vector with the requested new dense shape.
|
name
|
A name for the operation (optional).
|
Returns |
A tuple of Tensor objects (output_indices, output_shape).
|
output_indices
|
A Tensor of type int64 .
|
output_shape
|
A Tensor of type int64 .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2022-10-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-10-27 UTC."],[],[]]