class_docstr: Tests the metric computation related utilities.
class_docstr_tok: ["Tests","the","metric","computation","related","utilities","."]
docstr: Tests the topk recall computation.
docstr_tok: ["Tests","the","topk","recall","computation","."]
code: def test_weighted_recall(self):
      """Tests the topk recall computation."""
  
      logits = np.array(
          [
              [
                  [2, 3, 4],
                  [4, 3, 2],
                  [4, 2, 3],
                  [3, 2, 4],
                  [4, 2, 3],
              ]
          ]
      )
      labels = np.array(
          [[[1, 1, 0], [1, 1, 0], [1, 0, 0], [1, 0, 0], [0, 0, 0]]]
      )
  
      batch_size = 8
      logits = jnp.tile(logits, [batch_size, 1, 1])
      labels = jnp.tile(labels, [batch_size, 1, 1])
  
      recall = model_utils.weighted_recall(logits, labels)
      recall_expected = np.array(
          [[1 / 2, 1.0, 1.0, 0.0, 0.0]] * batch_size
      )
      self.assertSequenceAlmostEqual(
          recall.flatten(), recall_expected.flatten()
      )
  
imports: import itertools
  from absl.testing import absltest
  from absl.testing import parameterized
  from flax.training import common_utils
  import jax
  import jax.numpy
  import numpy
  from scenic.model_lib.base_models import model_utils
label_desc: Use image node_id 3 for calling the MetricTest obj's underlying member method code with example usage: obj.test_weighted_recall() without return types