tf.sets.size

View source on GitHub

Compute number of unique elements along last dimension of a.

tf.sets.size(
    a, validate_indices=True
)

Args:

Returns:

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

Raises: