| 18 | |
| 19 | |
| 20 | class MockTensor: |
| 21 | def __init__(self, data, layout=None): |
| 22 | self.shape = data.shape |
| 23 | self.dtype = ndd.dtype(data.dtype) |
| 24 | self.layout = layout |
| 25 | self.device = ndd.Device("cpu") |
| 26 | self.data = data |
| 27 | |
| 28 | @property |
| 29 | def ndim(self): |
| 30 | return len(self._shape) |
| 31 | |
| 32 | def __repr__(self): |
| 33 | return f"MockTensor(data={self.data}, layout={self.layout})" |
| 34 | |
| 35 | def __eq__(self, other): |
| 36 | return np.array_equal(self.data, other.data) and self.layout == other.layout |
| 37 | |
| 38 | |
| 39 | class MockBatch: |
no outgoing calls