class_docstr: Class for registry object which acts as central source of truth
  for MMF
docstr: Register a trainer to registry with key 'name'
  
  Args:
      name: Key with which the trainer will be registered.
  
  Usage::
  
      from mmf.common.registry import registry
      from mmf.trainers.custom_trainer import CustomTrainer
  
  
      @registry.register_trainer("custom_trainer")
      class CustomTrainer():
          ...
docstr_tok: ["Register","a","trainer","to","registry","with","key","'name'","Args",":","name",":","Key","with","which","the","trainer","will","be","registered",".","Usage",":",":","from","mmf.common.registry","import","registry","from","mmf.trainers.custom_trainer","import","CustomTrainer","@","registry.register_trainer","(","``","custom_trainer","''",")","class","CustomTrainer","(",")",":","..."]
code: def register_trainer(cls, name):
      r"""Register a trainer to registry with key 'name'
  
      Args:
          name: Key with which the trainer will be registered.
  
      Usage::
  
          from mmf.common.registry import registry
          from mmf.trainers.custom_trainer import CustomTrainer
  
  
          @registry.register_trainer("custom_trainer")
          class CustomTrainer():
              ...
  
      """
  
      def wrap(trainer_cls):
          cls.mapping["trainer_name_mapping"][name] = trainer_cls
          return trainer_cls
  
      return wrap
  
imports: from mmf.utils.env import setup_imports
label_desc: Use image node_id 1 for calling the Registry obj's underlying member method code with example usage: obj.register_trainer(cls, name) and returns: wrap, trainer_cls