(cls, func, types, args=(), kwargs=None)
| 154 | |
| 155 | @classmethod |
| 156 | def __torch_function__(cls, func, types, args=(), kwargs=None): |
| 157 | if kwargs is None: |
| 158 | kwargs = {} |
| 159 | loaded_args = [(a._load_tensor() if isinstance(a, NotYetLoadedTensor) else a) for a in args] |
| 160 | return func(*loaded_args, **kwargs) |
| 161 | # gc.collect would be costly here, maybe do it optionally |
| 162 | |
| 163 | def __getattr__(self, name): |
| 164 | # properties |
nothing calls this directly
no test coverage detected