MCPcopy Create free account
hub / github.com/MAC-VO/MAC-VO / __torch_function__

Method __torch_function__

Utility/Extensions/TensorExtension.py:117–121  ·  view source on GitHub ↗
(cls, func, types, args=(), kwargs=None)

Source from the content-addressed store, hash-verified

115
116 @classmethod
117 def __torch_function__(cls, func, types, args=(), kwargs=None):
118 if kwargs is None:
119 kwargs = {}
120 args = [data.tensor if isinstance(data, AutoScalingTensor) else data for data in args]
121 return func(*args, **kwargs)
122
123 # A further enhancement - we want AutoScale to behave exactly like the tensor it contains
124 def __getattribute__(self, name: str):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected