(self)
| 6 | |
| 7 | class TestTensorBytes(unittest.TestCase): |
| 8 | def test_bytes(self): |
| 9 | lst = Tensor(bytes(b"\xaa\xbb\xcc\xdd")) |
| 10 | assert lst.tolist() == [170, 187, 204, 221] |
| 11 | |
| 12 | def test_float_bytes(self): |
| 13 | lst = Tensor(bytes(struct.pack("ff", 0.234, 0.8585)), dtype=dtypes.float32) |