InTopKΒΆ

Outputs whether the targets are in the top K predictions.

Abstract Signature:

InTopK(targets: Tensor, predictions: Tensor, k: int)

PyTorch

API: β€”
Strategy: Plugin (in_top_k_plugin)

JAX (Core)

API: β€”
Strategy: Plugin (in_top_k_plugin)

Keras

API: keras.ops.in_top_k
Strategy: Direct Mapping

TensorFlow

API: tf.math.in_top_k
Strategy: Direct Mapping

Flax NNX

API: β€”
Strategy: Plugin (in_top_k_plugin)

PaxML / Praxis

API: β€”
Strategy: Plugin (in_top_k_plugin)