pytorch.org
  
  
    

Extending PyTorch — PyTorch 1.7.0 documentation 3



  
  
    
    
  
  


    @classmethod
    def __torch_function__(cls, func, types, args=(), kwargs=None):
        logging.info(f"func: {func.__name__}, args: {args!r}, kwargs: {kwargs!r}")
        if kwargs is None:
            kwargs = {}
        return super().__torch_function__(func, types, args, kwargs)

What type hints do I use for the arguments, and what type hint do I use for the return type: -> ReturnType?