class_docstr: :class:`TopkMetric` is a base object of top-k metrics. If you want to
  implement an top-k metric, you can inherit this class.
  
  Args:
      config (Config): The config of evaluator.
class_docstr_tok: [":","class",":","`","TopkMetric","`","is","a","base","object","of","top-k","metrics",".","If","you","want","to","implement","an","top-k","metric",",","you","can","inherit","this","class",".","Args",":","config","(","Config",")",":","The","config","of","evaluator","."]
docstr: Get the bool matrix indicating whether the corresponding item is positive
  and number of positive items for each user.
docstr_tok: ["Get","the","bool","matrix","indicating","whether","the","corresponding","item","is","positive","and","number","of","positive","items","for","each","user","."]
code: def used_info(self, dataobject):
      """Get the bool matrix indicating whether the corresponding item is positive
      and number of positive items for each user.
      """
      rec_mat = dataobject.get("rec.topk")
      topk_idx, pos_len_list = torch.split(
          rec_mat, [max(self.topk), 1], dim=1
      )
      return (
          topk_idx.to(torch.bool).numpy(),
          pos_len_list.squeeze(-1).numpy(),
      )
  
file_path: RecBole/recbole/evaluator/base_metric.py
imports: import torch
  from recbole.utils import EvaluatorType
label_desc: Use image node_id 2 for calling the TopkMetric obj's underlying member method code with example usage: obj.used_info(dataobject) and returns: topk_idx,  pos_len_list