MCPcopy
hub / github.com/tinygrad/tinygrad / test_tensor_bytes

Method test_tensor_bytes

test/backend/test_tensor.py:479–484  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

477 with self.assertRaises(AttributeError): Tensor([3], dtype=(dtypes.int,))
478
479 def test_tensor_bytes(self):
480 data = b"abc123"
481 t = Tensor(data)
482 assert t.dtype == dtypes.uint8
483 assert t.shape == (6,)
484 np.testing.assert_equal(t.numpy(), list(data))
485
486 def test_tensor_copy(self):
487 x = copy.deepcopy(Tensor.ones((3,3,3)))

Callers

nothing calls this directly

Calls 3

numpyMethod · 0.95
TensorClass · 0.90
assert_equalMethod · 0.80

Tested by

no test coverage detected