ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more

SetSize

public final class SetSize

Number of unique elements along last dimension of input `set`.

Input `set` is a `SparseTensor` represented by `set_indices`, `set_values`, and `set_shape`. The last dimension contains values in a set, duplicates are allowed but ignored.

If `validate_indices` is `True`, this op validates the order and range of `set` indices.

Nested Classes

class SetSize.Options Optional attributes for SetSize  

Public Methods

Output<Integer>
asOutput()
Returns the symbolic handle of a tensor.
static <T> SetSize
create(Scope scope, Operand<Long> setIndices, Operand<T> setValues, Operand<Long> setShape, Options... options)
Factory method to create a class wrapping a new SetSize operation.
Output<Integer>
size()
For `set` ranked `n`, this is a `Tensor` with rank `n-1`, and the same 1st `n-1` dimensions as `set`.
static SetSize.Options
validateIndices(Boolean validateIndices)

Inherited Methods

Public Methods

public Output<Integer> asOutput ()

Returns the symbolic handle of a tensor.

Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.

public static SetSize create (Scope scope, Operand<Long> setIndices, Operand<T> setValues, Operand<Long> setShape, Options... options)

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

Parameters
scope current scope
setIndices 2D `Tensor`, indices of a `SparseTensor`.
setValues 1D `Tensor`, values of a `SparseTensor`.
setShape 1D `Tensor`, shape of a `SparseTensor`.
options carries optional attributes values
Returns
  • a new instance of SetSize

public Output<Integer> size ()

For `set` ranked `n`, this is a `Tensor` with rank `n-1`, and the same 1st `n-1` dimensions as `set`. Each value is the number of unique elements in the corresponding `[0...n-1]` dimension of `set`.

public static SetSize.Options validateIndices (Boolean validateIndices)