-[ Examples ]-



import inspect
my_add = torch.overrides.get_testing_overrides()[torch.add]
inspect.signature(my_add)
   



torch.overrides.handle_torch_function(public_api, relevant_args, args, *kwargs)
Implement a function with checks for "torch_function"
   overrides.
See torch::autograd::handle_torch_function for the equivalent of
   this function in the C++ implementation.
Parameters:
      * public_api (function) -- Function exposed by the public
        torch API originally called like "public_api(args, *kwargs)"
        on which arguments are now being checked.
  * **relevant_args** (*iterable*) -- Iterable of arguments to
    check for __torch_function__ methods.

  * **args** (*tuple*) -- Arbitrary positional arguments
    originally passed into "public_api".

  * **kwargs** (*tuple*) -- Arbitrary keyword arguments originally
    passed into "public_api".

Returns: