tf.contrib.metrics.set_difference(a, b, aminusb=True, validate_indices=True)
tf.sets.set_difference(a, b, aminusb=True, validate_indices=True)
See the guide: Metrics (contrib) > Set Ops
Compute set difference of elements in last dimension of a
and b
.
All but the last dimension of a
and b
must match.
Example:
a = [ [ [ [1, 2], [3], ], [ [4], [5, 6], ], ], ] b = [ [ [ [1, 3], [2], ], [ [4, 5], [5, 6, 7, 8], ], ], ] set_difference(a, b, aminusb=True) = [ [ [ [2], [3], ], [ [], [], ], ], ]
a
: Tensor
or SparseTensor
of the same type as b
. If sparse, indices must be sorted in row-major order.b
: Tensor
or SparseTensor
of the same type as a
. If sparse, indices must be sorted in row-major order.aminusb
: Whether to subtract b
from a
, vs vice versa.validate_indices
: Whether to validate the order and range of sparse indices in a
and b
.A SparseTensor
whose shape is the same rank as a
and b
, and all but the last dimension the same. Elements along the last dimension contain the differences.
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_difference