/aosp_15_r20/external/pytorch/test/ |
H A D | test_overrides.py | 145 def __torch_function__(cls, func, types, args=(), kwargs=None): member in DiagonalTensor 215 def __torch_function__(cls, func, types, args=(), kwargs=None): member in SubTensor 366 def __torch_function__(cls, func, types, args=(), kwargs=None): member in TensorLike 600 def __torch_function__(cls, func, types, args=(), kwargs=None): member in TestTorchFunctionOverride.test_grad.Dummy 612 def __torch_function__(cls, func, types, args=(), kwargs=None): member in TestTorchFunctionOverride.test_pow_rpow.NothingImplemented 617 def __torch_function__(cls, func, types, args=(), kwargs=None): member in TestTorchFunctionOverride.test_pow_rpow.RPowOnly 797 … return lambda *a, **kw: wrap(self.__torch_function__(c, (Wrapper,), args=a, kwargs=kw)) 799 … return lambda *a, **kw: wrap(self.__torch_function__(c, (Wrapper,), args=(self,) + a, kwargs=kw)) 817 def __torch_function__(cls, func, types, args=(), kwargs=None): member in Wrapper 836 return self.__torch_function__(torch.add, (Wrapper,), (self, other)) [all …]
|
/aosp_15_r20/external/pytorch/functorch/dim/ |
H A D | wrap_type.py | 29 def _py_wrap_method(orig, __torch_function__): argument 31 return __torch_function__(orig, None, args, kwargs) 36 def wrap_type(use_c, to_patch, pattern, __torch_function__): argument 47 return property(wrap_method(orig.__get__, __torch_function__)) 70 setattr(to_patch, name, wrap_method(obj, __torch_function__))
|
H A D | __init__.py | 48 __torch_function__ = classmethod(_C.__torch_function__) variable in _Tensor 51 __torch_function__ = reference.__torch_function__ variable in _Tensor 112 wrap_type(use_c, _Tensor, torch.Tensor, _Tensor.__torch_function__)
|
H A D | reference.py | 167 def __torch_function__(self, orig, cls, args, kwargs=empty_dict): function 306 return self.__torch_function__(torch.Tensor.expand, None, (self, *sizes)) 423 return _Tensor.__torch_function__(_orig_getitem, None, (self, input))
|
/aosp_15_r20/external/pytorch/docs/source/notes/ |
H A D | extending.rst | 474 If your custom Python type defines a method named ``__torch_function__``, PyTorch 475 will invoke your ``__torch_function__`` implementation when an instance of your 478 :mod:`torch` namespace which your ``__torch_function__`` implementation can call, 531 Adding a ``__torch_function__`` implementation to ``ScalarTensor`` makes it 533 this time adding a ``__torch_function__`` implementation:: 548 def __torch_function__(cls, func, types, args=(), kwargs=None): 558 The ``__torch_function__`` method takes four arguments: ``func``, a reference 560 types of Tensor-likes that implement ``__torch_function__``, ``args``, the 568 ``__torch_function__`` API, it is just a useful design pattern for 601 a tensor or tensor-like that defines ``__torch_function__``, for example for [all …]
|
/aosp_15_r20/external/pytorch/benchmarks/overrides_benchmark/ |
H A D | README.md | 1 # `__torch_function__` micro-benchmarks 3 This benchmark suite provides a systemic way to measure the performance of `__torch_function__` ove… 32 …__torch_function__` should add zero overhead for `torch.Tensor` inputs, a small overhead for subcl… 36 When modifying any of the machinery around `__torch_function__`, run the benchmark for both the fea…
|
H A D | common.py | 21 def __torch_function__(cls, func, types, args=(), kwargs=None): member in WithTorchFunction 30 def __torch_function__(cls, func, types, args=(), kwargs=None): member in SubWithTorchFunction 34 return super().__torch_function__(func, types, args, kwargs)
|
/aosp_15_r20/external/pytorch/test/dynamo/ |
H A D | test_subclasses.py | 151 def __torch_function__(cls, func, types, args=(), kwargs=None): member in BaseTorchFunction 154 return super().__torch_function__(func, types, args, kwargs) 159 def __torch_function__(cls, func, types, args=(), kwargs=None): member in MockSubclass 170 def __torch_function__(cls, func, types, args=(), kwargs=None): member in AttrSubclass 179 def __torch_function__(cls, func, types, args=(), kwargs=None): member in DummyNDim 186 return super().__torch_function__(func, types, args, kwargs) 194 def __torch_function__(cls, func, types, args=(), kwargs=None): member in WrapperSubclass 206 def __torch_function__(cls, func, types, args=(), kwargs=None): member in SigmoidToExpSubclass 211 return super().__torch_function__(torch.Tensor.exp, types, args, kwargs) 213 return super().__torch_function__(func, types, args, kwargs) [all …]
|
/aosp_15_r20/external/pytorch/torch/nn/ |
H A D | parameter.py | 92 __torch_function__ = _disabled_torch_function_impl variable in Parameter 161 def __torch_function__(cls, func, types, args=(), kwargs=None): member in UninitializedTensorMixin 167 return super().__torch_function__(func, types, args, kwargs) 251 __torch_function__ = _disabled_torch_function_impl variable in Buffer
|
/aosp_15_r20/external/pytorch/docs/source/ |
H A D | torch.overrides.rst | 7 This module exposes various helper functions for the ``__torch_function__`` 9 ``__torch_function__`` protocol.
|
/aosp_15_r20/external/pytorch/torch/fx/ |
H A D | README.md | 89 …__torch_function__`](https://pytorch.org/docs/stable/notes/extending.html#extending-torch). If any… 102 …dule is run with Proxies as inputs, and recording happens via the `__torch_function__` dispatch pa…
|
/aosp_15_r20/external/pytorch/test/quantization/core/experimental/ |
H A D | test_bits.py | 44 def __torch_function__(cls, func, types, args=(), kwargs=None): member in Int16Tensor 45 return super().__torch_function__(func, types, args, kwargs)
|
/aosp_15_r20/external/pytorch/torch/testing/_internal/ |
H A D | common_subclass.py | 168 def __torch_function__(cls, func, types, args=(), kwargs=None): member in NonWrapperTensor 169 result = super().__torch_function__(func, types, args, kwargs)
|
/aosp_15_r20/external/pytorch/torch/_dynamo/variables/ |
H A D | torch_function.py | 228 )(value.__torch_function__.__func__) 230 return SourcelessBuilder.create(tx, value.__torch_function__.__func__)
|
H A D | tensor.py | 679 )(py_cls.__torch_function__.__func__) 1320 )(self.value.__torch_function__)
|
/aosp_15_r20/external/pytorch/tools/autograd/templates/ |
H A D | annotated_fn_args.py.in | 3 testing __torch_function__. See tests/test_overrides.py.
|
/aosp_15_r20/external/pytorch/test/nn/ |
H A D | test_load_state_dict.py | 507 def __torch_function__(cls, func, types, args=(), kwargs=None): member in MyLoadTensor 515 def __torch_function__(cls, func, types, args=(), kwargs=None): member in MyLoadTensor2 521 def __torch_function__(cls, func, types, args=(), kwargs=None): member in MyBrokenLoadTensor
|
/aosp_15_r20/external/pytorch/torch/export/ |
H A D | _safeguard.py | 18 def __torch_function__(self, func, types, args=(), kwargs=None): member in AutogradStateOpsFailSafeguard
|
/aosp_15_r20/external/pytorch/test/profiler/ |
H A D | test_profiler_tree.py | 56 def __torch_function__(cls, func, types, args=(), kwargs=None): member in TorchFunctionTensor 57 return super().__torch_function__(func, types, args, kwargs)
|
/aosp_15_r20/external/pytorch/torch/utils/ |
H A D | _device.py | 102 def __torch_function__(self, func, types, args=(), kwargs=None): member in DeviceContext
|
/aosp_15_r20/external/pytorch/torch/nn/utils/_expanded_weights/ |
H A D | expanded_weights_impl.py | 125 def __torch_function__(cls, func, _, args=(), kwargs=None): member in ExpandedWeight
|
/aosp_15_r20/external/pytorch/torch/_prims/ |
H A D | context.py | 105 def __torch_function__( member in TorchRefsMode
|
/aosp_15_r20/external/pytorch/torch/nn/attention/ |
H A D | bias.py | 282 def __torch_function__(cls, func, types, args=(), kwargs=None): member in CausalBias
|
/aosp_15_r20/external/pytorch/torch/ |
H A D | overrides.py | 322 Tensor.__torch_function__, 1645 and arg_type.__torch_function__ != torch._C._disabled_torch_function_impl 1717 result = mode.__torch_function__(public_api, types, args, kwargs) 1725 torch_func_method = overloaded_arg.__torch_function__ 2032 def __torch_function__(self, func, types, args=(), kwargs=None): member in TorchFunctionMode 2080 def __torch_function__(self, func, types, args=(), kwargs=None): member in BaseTorchFunctionMode
|
/aosp_15_r20/external/pytorch/torch/masked/maskedtensor/ |
H A D | core.py | 285 def __torch_function__(cls, func, types, args=(), kwargs=None): member in MaskedTensor
|