(self)
| 71 | np.testing.assert_array_equal(loaded.numpy(), arr) |
| 72 | |
| 73 | def test_hash_matches_python_impl(self): |
| 74 | arr = np.arange(256, dtype=np.uint8) |
| 75 | h = Tensor(arr).fs_store().realize() |
| 76 | # the hash from fs_store should match the pure-Python hash_file reference |
| 77 | padded = arr.tobytes().ljust(Tensor.CHUNK_SIZE, b'\0') |
| 78 | self.assertEqual(h.data().tobytes(), hash_file(padded)) |
| 79 | |
| 80 | if __name__ == "__main__": |
| 81 | unittest.main() |