I want to implent tf.nn.in_top_k in pytorch. Here is the link of tf.nn.in_top_k,
tf.math.in_top_k(
targets, predictions, k, name=None
)
It computed precision at k as a bool Tensor and will return a Tensor of type bool.
I wonder whether there are similar api in pytorch?