(self)
| 22 | |
| 23 | class TensorTest(unittest.TestCase): |
| 24 | def test_basic(self): |
| 25 | target = Target() |
| 26 | target.arch = Target.X86Arch() |
| 27 | target.bits = Target.Bit.k64 |
| 28 | target.os = Target.OS.Linux |
| 29 | tensor = Tensor() |
| 30 | data = np.random.random([10, 5]) |
| 31 | tensor.from_numpy(data, target) |
| 32 | |
| 33 | np.testing.assert_allclose(tensor.numpy(), data) |
| 34 | |
| 35 | |
| 36 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected