class_docstr: Converter base class to be reused by various converters.
  Converter allows one to convert data from various source types to a particular
  destination type. Each source type needs to register its converter. The
  registration for each source type is valid for all descendants of that type.
docstr: Registers a converter for the specified type.
  Can be used as a decorator (if converter is None), or called as a method.
  
  Args:
      from_type (type): type to register the converter for;
          all instances of this type will use the same converter
      converter (callable): converter to be registered for the given
          type; if None, this method is assumed to be a decorator for the converter
docstr_tok: ["Registers","a","converter","for","the","specified","type",".","Can","be","used","as","a","decorator","(","if","converter","is","None",")",",","or","called","as","a","method",".","Args",":","from_type","(","type",")",":","type","to","register","the","converter","for",";","all","instances","of","this","type","will","use","the","same","converter","converter","(","callable",")",":","converter","to","be","registered","for","the","given","type",";","if","None",",","this","method","is","assumed","to","be","a","decorator","for","the","converter"]
code: def register(cls, from_type: Type, converter: Any = None):
      """
      Registers a converter for the specified type.
      Can be used as a decorator (if converter is None), or called as a method.
  
      Args:
          from_type (type): type to register the converter for;
              all instances of this type will use the same converter
          converter (callable): converter to be registered for the given
              type; if None, this method is assumed to be a decorator for the converter
      """
  
      if converter is not None:
          cls._do_register(from_type, converter)
  
      def wrapper(converter: Any) -> Any:
          cls._do_register(from_type, converter)
          return converter
  
      return wrapper
  
file_path: detectron2/projects/DensePose/densepose/converters/base.py
imports: from typing import Any, Tuple, Type
  import torch
label_desc: Use image node_id 1 for calling the BaseConverter obj's underlying member method code with example usage: obj.register(cls, from_type, converter) and returns: wrapper, converter