T
- data type for resultValues()
output@Operator(group="sparse") public final class DenseToSparseSetOperation<T> extends PrimitiveOp
See SetOperationOp::SetOperationFromContext for values of `set_operation`.
Input `set2` is a `SparseTensor` represented by `set2_indices`, `set2_values`, and `set2_shape`. For `set2` ranked `n`, 1st `n-1` dimensions must be the same as `set1`. Dimension `n` contains values in a set, duplicates are allowed but ignored.
If `validate_indices` is `True`, this op validates the order and range of `set2` indices.
Output `result` is a `SparseTensor` represented by `result_indices`, `result_values`, and `result_shape`. For `set1` and `set2` ranked `n`, this has rank `n` and the same 1st `n-1` dimensions as `set1` and `set2`. The `nth` dimension contains the result of `set_operation` applied to the corresponding `[0...n-1]` dimension of `set`.
Modifier and Type | Class and Description |
---|---|
static class |
DenseToSparseSetOperation.Options
Optional attributes for
DenseToSparseSetOperation |
operation
Modifier and Type | Method and Description |
---|---|
static <T> DenseToSparseSetOperation<T> |
create(Scope scope,
Operand<T> set1,
Operand<Long> set2Indices,
Operand<T> set2Values,
Operand<Long> set2Shape,
String setOperation,
DenseToSparseSetOperation.Options... options)
Factory method to create a class wrapping a new DenseToSparseSetOperation operation.
|
Output<Long> |
resultIndices()
2D indices of a `SparseTensor`.
|
Output<Long> |
resultShape()
1D `Tensor` shape of a `SparseTensor`.
|
Output<T> |
resultValues()
1D values of a `SparseTensor`.
|
static DenseToSparseSetOperation.Options |
validateIndices(Boolean validateIndices) |
equals, hashCode, op, toString
public static <T> DenseToSparseSetOperation<T> create(Scope scope, Operand<T> set1, Operand<Long> set2Indices, Operand<T> set2Values, Operand<Long> set2Shape, String setOperation, DenseToSparseSetOperation.Options... options)
scope
- current scopeset1
- `Tensor` with rank `n`. 1st `n-1` dimensions must be the same as `set2`.
Dimension `n` contains values in a set, duplicates are allowed but ignored.set2Indices
- 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major
order.set2Values
- 1D `Tensor`, values of a `SparseTensor`. Must be in row-major
order.set2Shape
- 1D `Tensor`, shape of a `SparseTensor`. `set2_shape[0...n-1]` must
be the same as the 1st `n-1` dimensions of `set1`, `result_shape[n]` is the
max set size across `n-1` dimensions.setOperation
- options
- carries optional attributes valuespublic static DenseToSparseSetOperation.Options validateIndices(Boolean validateIndices)
validateIndices
- Copyright © 2022. All rights reserved.