class_docstr: Class for registry object which acts as central source of truth
  for MMF
docstr: Register a metric to registry with key 'name'
  
  Args:
      name: Key with which the metric will be registered.
  
  Usage::
  
      from mmf.common.registry import registry
      from mmf.modules.metrics import BaseMetric
  
  
      @registry.register_metric("r@1")
      class RecallAt1(BaseMetric):
          ...
docstr_tok: ["Register","a","metric","to","registry","with","key","'name'","Args",":","name",":","Key","with","which","the","metric","will","be","registered",".","Usage",":",":","from","mmf.common.registry","import","registry","from","mmf.modules.metrics","import","BaseMetric","@","registry.register_metric","(","``","r","@","1","''",")","class","RecallAt1","(","BaseMetric",")",":","..."]
code: def register_metric(cls, name):
      r"""Register a metric to registry with key 'name'
  
      Args:
          name: Key with which the metric will be registered.
  
      Usage::
  
          from mmf.common.registry import registry
          from mmf.modules.metrics import BaseMetric
  
  
          @registry.register_metric("r@1")
          class RecallAt1(BaseMetric):
              ...
  
      """
  
      def wrap(func):
          from mmf.modules.metrics import BaseMetric
  
          assert issubclass(
              func, BaseMetric
          ), "All Metric must inherit BaseMetric class"
          cls.mapping["metric_name_mapping"][name] = func
          return func
  
      return wrap
  
imports: from mmf.utils.env import setup_imports
label_desc: Use image node_id 4 for calling the Registry obj's underlying member method code with example usage: obj.register_metric(cls, name) and returns: wrap, func