class_docstr: The base class for Contextual Bandit models. A minimal implementation of a specific model requires providing a specific
      implementation for only the cb_training_step() method.
  The main functionality implemented in this base class is the integration of Offline Evaluation into the training loop.
class_docstr_tok: ["The","base","class","for","Contextual","Bandit","models",".","A","minimal","implementation","of","a","specific","model","requires","providing","a","specific","implementation","for","only","the","cb_training_step","(",")","method",".","The","main","functionality","implemented","in","this","base","class","is","the","integration","of","Offline","Evaluation","into","the","training","loop","."]
code: def _log_recmetrics(self, step: Optional[int] = None) -> None:
      recmetric_module = self.recmetric_module
      assert recmetric_module is not None
      computation_results = recmetric_module.compute()
      if get_rank() == 0:
          logger_ = self.logger
          assert logger_ is not None
          computation_results = {
              "[model]" + k: v.item()
              if isinstance(v, torch.Tensor)
              else v
              for k, v in computation_results.items()
          }
          logger_.log_metrics(computation_results, step=step)
          logger.info(f"Logging torchrec metrics {computation_results}")
  
imports: import logging
  from abc import ABC, abstractmethod
  from typing import final, Optional
  import torch
  from reagent.core.types import CBInput
  from reagent.core.utils import get_rank
  from reagent.evaluation.cb.base_evaluator import BaseOfflineEval
  from reagent.models.cb_base_model import UCBBaseModel
  from reagent.models.mab import MABBaseModel
  from reagent.training.cb.utils import add_chosen_arm_features, get_model_actions
  from reagent.training.reagent_lightning_module import ReAgentLightningModule
  from torchrec.metrics.metric_module import RecMetricModule
label_desc: Use image node_id 9 for calling the BaseCBTrainerWithEval obj's underlying member method code with example usage: obj._log_recmetrics(step) without return types