DenseToSparseSetOperation

public final class DenseToSparseSetOperation

Applies set operation along last dimension of `Tensor` and `SparseTensor`.

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`.

Nested Classes

class DenseToSparseSetOperation.Options Optional attributes for DenseToSparseSetOperation

Constants

String OP_NAME The name of this op, as known by TensorFlow core engine

Public Methods

static <T extends TType > DenseToSparseSetOperation <T>
create ( Scope scope, Operand <T> set1, Operand < TInt64 > set2Indices, Operand <T> set2Values, Operand < TInt64 > set2Shape, String setOperation, Options... options)
Factory method to create a class wrapping a new DenseToSparseSetOperation operation.
Output < TInt64 >
resultIndices ()
2D indices of a `SparseTensor`.
Output < TInt64 >
resultShape ()
1D `Tensor` shape of a `SparseTensor`.
Output <T>
resultValues ()
1D values of a `SparseTensor`.
static DenseToSparseSetOperation.Options
validateIndices (Boolean validateIndices)

Inherited Methods

Constants

public static final String OP_NAME

The name of this op, as known by TensorFlow core engine

Constant Value: "DenseToSparseSetOperation"

Public Methods

public static DenseToSparseSetOperation <T> create ( Scope scope, Operand <T> set1, Operand < TInt64 > set2Indices, Operand <T> set2Values, Operand < TInt64 > set2Shape, String setOperation, Options... options)

Factory method to create a class wrapping a new DenseToSparseSetOperation operation.

Parameters
scope current scope
set1 `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.
options carries optional attributes values
Returns
  • a new instance of DenseToSparseSetOperation

public Output < TInt64 > resultIndices ()

2D indices of a `SparseTensor`.

public Output < TInt64 > resultShape ()

1D `Tensor` shape of a `SparseTensor`. `result_shape[0...n-1]` is the same as the 1st `n-1` dimensions of `set1` and `set2`, `result_shape[n]` is the max result set size across all `0...n-1` dimensions.

public Output <T> resultValues ()

1D values of a `SparseTensor`.

public static DenseToSparseSetOperation.Options validateIndices (Boolean validateIndices)