MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / _TensorMethodOrModule

Class _TensorMethodOrModule

python/paddle/__init__.py:814–836  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

812
813
814class _TensorMethodOrModule:
815 def __init__(self):
816 import paddle.tensor as tensor_module
817
818 from .tensor.creation import tensor as tensor_api
819
820 self.module = tensor_module
821 self.method = tensor_api
822
823 def __call__(self, *args, **kwargs):
824 return self.method(*args, **kwargs)
825
826 def __getattr__(self, name):
827 return getattr(self.module, name)
828
829 def __repr__(self):
830 return repr(self.method)
831
832 def __str__(self):
833 return str(self.method)
834
835 def __dir__(self):
836 return dir(self.module)
837
838
839tensor = _TensorMethodOrModule() # noqa: F811

Callers 1

__init__.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected