class_docstr: Class for registry object which acts as central source of truth
  for MMF
docstr: Register a decoder to registry with key 'name'
  
  Args:
      name: Key with which the decoder will be registered.
  
  Usage::
  
      from mmf.common.registry import registry
      from mmf.utils.text import TextDecoder
  
  
      @registry.register_decoder("nucleus_sampling")
      class NucleusSampling(TextDecoder):
          ...
docstr_tok: ["Register","a","decoder","to","registry","with","key","'name'","Args",":","name",":","Key","with","which","the","decoder","will","be","registered",".","Usage",":",":","from","mmf.common.registry","import","registry","from","mmf.utils.text","import","TextDecoder","@","registry.register_decoder","(","``","nucleus_sampling","''",")","class","NucleusSampling","(","TextDecoder",")",":","..."]
code: def register_decoder(cls, name):
      r"""Register a decoder to registry with key 'name'
  
      Args:
          name: Key with which the decoder will be registered.
  
      Usage::
  
          from mmf.common.registry import registry
          from mmf.utils.text import TextDecoder
  
  
          @registry.register_decoder("nucleus_sampling")
          class NucleusSampling(TextDecoder):
              ...
  
      """
  
      def wrap(decoder_cls):
          from mmf.utils.text import TextDecoder
  
          assert issubclass(
              decoder_cls, TextDecoder
          ), "All decoders must inherit TextDecoder class"
          cls.mapping["decoder_name_mapping"][name] = decoder_cls
          return decoder_cls
  
      return wrap
  
imports: from mmf.utils.env import setup_imports
label_desc: Use image node_id 16 for calling the Registry obj's underlying member method code with example usage: obj.register_decoder(cls, name) and returns: wrap, decoder_cls