Says whether the targets are in the top
Compat aliases for migration
See Migration guide for more details.
tf.raw_ops.InTopKV2( predictions, targets, k, name=None )
This outputs a
batch_size bool array, an entry
true if the
prediction for the target class is among the top
k predictions among
all predictions for example
i. Note that the behavior of
TopK op in its handling of ties; if multiple classes have the
same prediction value and straddle the top-
k boundary, all of those
classes are considered to be in the top
More formally, let
\(predictions_i\) be the predictions for all classes for example
\(targets_i\) be the target class for example
\(out_i\) be the output for example
Tensor. Must be one of the following types:
batch_sizevector of class ids.
Tensor. Must have the same type as
targets. Number of top elements to look at for computing precision.
name: A name for the operation (optional).
Tensor of type