@Operator(group="sparse") public final class SparseReshape extends RawOp
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
.
Modifier and Type | Class and Description |
---|---|
static class |
SparseReshape.Inputs |
Modifier and Type | Field and Description |
---|---|
static String |
OP_NAME
The name of this op, as known by TensorFlow core engine
|
Constructor and Description |
---|
SparseReshape(Operation operation) |
Modifier and Type | Method and Description |
---|---|
static SparseReshape |
create(Scope scope,
Operand<TInt64> inputIndices,
Operand<TInt64> inputShape,
Operand<TInt64> newShape)
Factory method to create a class wrapping a new SparseReshape operation.
|
Output<TInt64> |
outputIndices()
Gets outputIndices.
|
Output<TInt64> |
outputShape()
Gets outputShape.
|
public static final String OP_NAME
public SparseReshape(Operation operation)
@Endpoint(describeByClass=true) public static SparseReshape create(Scope scope, Operand<TInt64> inputIndices, Operand<TInt64> inputShape, Operand<TInt64> newShape)
scope
- current scopeinputIndices
- 2-D. N x R_in
matrix with the indices of non-empty values in a
SparseTensor.inputShape
- 1-D. R_in
vector with the input SparseTensor's dense shape.newShape
- 1-D. R_out
vector with the requested new dense shape.public Output<TInt64> outputIndices()
N x R_out
matrix with the updated indices of non-empty
values in the output SparseTensor.Copyright © 2015–2022. All rights reserved.