(self, name: str)
| 122 | |
| 123 | # A further enhancement - we want AutoScale to behave exactly like the tensor it contains |
| 124 | def __getattribute__(self, name: str): |
| 125 | if name in {'_tensor', 'tensor', 'push', '__class__'}: |
| 126 | return object.__getattribute__(self, name) |
| 127 | try: |
| 128 | return object.__getattribute__(self, name) |
| 129 | except AttributeError: |
| 130 | # If it's not a class attribute, delegate to the tensor |
| 131 | tensor = object.__getattribute__(self, 'tensor') |
| 132 | return getattr(tensor, name) |
| 133 | |
| 134 | # Magic methods cannot be forwarded automatically, so has to do this |
| 135 | def __getitem__(self, slice): return self.tensor.__getitem__(slice) |
nothing calls this directly
no outgoing calls
no test coverage detected