W3cubDocs

/TensorFlow Python

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

tf.contrib.metrics.set_size(a, validate_indices=True)

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

See the guide: Metrics (contrib) > Set Ops

Compute number of unique elements along last dimension of a.

Args:

  • a: SparseTensor, with indices sorted in row-major order.
  • validate_indices: Whether to validate the order and range of sparse indices in a.

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:

  • TypeError: If a is an invalid types.

Defined in tensorflow/python/ops/sets_impl.py.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/sets/set_size