Converts a `RaggedTensor` into a `SparseTensor` with the same values.
input=ragged.from_nested_row_splits(rt_dense_values, rt_nested_splits) output=SparseTensor(indices=sparse_indices, values=sparse_values, dense_shape=sparse_dense_shape)
Public Methods
| static <U, T extends Number> RaggedTensorToSparse<U> | |
| Output<Long> |
sparseDenseShape()
`sparse_dense_shape` is a tight bounding box of the input `RaggedTensor`.
|
| Output<Long> |
sparseIndices()
The indices for the `SparseTensor`.
|
| Output<U> |
sparseValues()
The values of the `SparseTensor`.
|
Inherited Methods
Public Methods
public static RaggedTensorToSparse<U> create (Scope scope, Iterable<Operand<T>> rtNestedSplits, Operand<U> rtDenseValues)
Factory method to create a class wrapping a new RaggedTensorToSparse operation.
Parameters
| scope | current scope |
|---|---|
| rtNestedSplits | The `row_splits` for the `RaggedTensor`. |
| rtDenseValues | The `flat_values` for the `RaggedTensor`. |
Returns
- a new instance of RaggedTensorToSparse
public Output<Long> sparseDenseShape ()
`sparse_dense_shape` is a tight bounding box of the input `RaggedTensor`.