docstr: This test verifies that the meter works as expected on a single
  update + reset + same single update.
docstr_tok: ["This","test","verifies","that","the","meter","works","as","expected","on","a","single","update","+","reset","+","same","single","update","."]
code: def test_non_onehot_target(self):
      """
      This test verifies that the meter works as expected on a single
      update + reset + same single update.
      """
      meter = RecallAtKMeter(topk=[1, 2])
  
      # Batchsize = 2, num classes = 3, score is probability of class
      model_outputs = [
          torch.tensor(
              [[0.05, 0.4, 0.05], [0.15, 0.65, 0.2], [0.4, 0.2, 0.4]]
          ),
          torch.tensor(
              [[0.2, 0.4, 0.4], [0.2, 0.65, 0.15], [0.1, 0.8, 0.1]]
          ),
      ]
  
      # One-hot encoding, 1 = positive for class
      targets = [
          torch.tensor(
              [[1], [1], [1]]
          ),  # [[0, 1, 0], [0, 1, 0], [0, 1, 0]]
          torch.tensor(
              [[0], [1], [2]]
          ),  # [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
      ]
  
      # Note for ties, we select randomly, so we should not use ambiguous ties
      # First batch has top-1 recall of 2/3.0, top-2 recall of 2/6.0
      # Second batch has top-1 recall of 1/3.0, top-2 recall of 4/6.0
      expected_value = {"top_1": 3 / 6.0, "top_2": 6 / 12.0}
  
      self.meter_update_and_reset_test(
          meter, model_outputs, targets, expected_value
      )
  
file_path: ClassyVision/test/meters_recall_meter_test.py
imports: import torch
  from classy_vision import meters
  from classy_vision.meters import RecallAtKMeter
  from test.generic.meter_test_utils import ClassificationMeterTest
label_desc: Use image node_id 9 for calling the TestRecallAtKMeter obj's underlying member method code with example usage: obj.test_non_onehot_target() without return types