Reputation:
I am looking for TensorFlow equivalents to the following Numpy operations
allclose(a, b[, rtol, atol, equal_nan])
Returns True
if two arrays
are element-wise equal within a tolerance. isclose(a, b[, rtol, atol, equal_nan])
Returns a boolean array where two arrays are element-wise equal within a tolerance. all(a[, axis, out, keepdims])
Test whether all array elements along a given axis evaluate to True
.any(a[, axis, out, keepdims])
Test whether any array element along a
given axis evaluates to True
.Upvotes: 0
Views: 1231
Reputation: 3358
Unfortunately, there are no ops that do exactly the same thing for allclose
or isclose
, but you can have workarounds.
isclose
: combine tf.abs
, tf.sub
, tf.less
or tf.less_equal
.
allclose
: based on isclose, use tf.reduce_all
in addition
all
: use tf.reduce_all
any
: use tf.reduce_any
Upvotes: 3