class_docstr: A ``TorchFunctionMode`` allows you to override the meaning of all
  ``__torch_function__`` overrideable functions within a dynamic scope,
  without having to actually create a tensor subclass or manually
  monkey-patch functions in the PyTorch API.  Some common situations
  where you should use a mode:
  
      * You want to override the meaning of factory functions, or other
        functions that do not otherwise take a tensor as an argument
        (these cannot be overridden with tensor subclasses).
  
      * You want to override the behavior of all functions without needing
        to wrap your inputs in tensor subclasses; e.g., if you are just
        interested in logging intermediate computations.
  
      * You want to control the order of execution of various tensor
        subclasses explicitly, rather than implicitly via the return of
        ``NotImplemented``.
  
  Independent subclasses of :class:`TorchFunctionMode` are compositional:
  modes can be pushed onto a stack using ``with MyMode():``.
  When you call functions in the PyTorch API inside your
  ``__torch_function__`` implementation, by default, they will forward on to
  the next mode on the mode stack.  If you want recursively call back into
  your current ``__torch_function__`` implementation, either explicitly
  invoke ``self.__torch_function__(...)``, or use the context manager
  ``enable_torch_function_mode(self, replace=self.inner)`` to make PyTorch
  API self-referential (beware of infinite loops, in this case!)
code: def __init__(self):
      pass
  
imports: import __future__
  import collections
  import functools
  import types
  import warnings
  from typing import Dict, Set, List, Any, Callable, Iterable, Type, Tuple
  from functools import wraps
  import contextlib
  import torch
  from torch._C import _has_torch_function, _has_torch_function_unary, _has_torch_function_variadic, _add_docstr, _push_on_torch_function_stack, _pop_torch_function_stack, _get_function_stack_at, _len_torch_function_stack, _is_torch_function_mode_enabled
label_desc: Use image node_id 1 to create a new TorchFunctionMode object  with example: obj = TorchFunctionMode()