mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-09 15:08:02 -05:00
remove unreachable tensor dtype assert (#8190)
it would have failed in `to_dtype`. added some tests for it too
This commit is contained in:
@@ -424,6 +424,10 @@ class TestTinygrad(unittest.TestCase):
|
||||
data = [np.array(1.0), np.array(2.0), np.array(3.0)]
|
||||
np.testing.assert_equal(Tensor(data).numpy(), np.array(data))
|
||||
|
||||
def test_tensor_dtype_errors(self):
|
||||
with self.assertRaises(AttributeError): Tensor([3], dtype="typo")
|
||||
with self.assertRaises(TypeError): Tensor([3], dtype=(dtypes.int,))
|
||||
|
||||
def test_tensor_bytes(self):
|
||||
data = b"abc123"
|
||||
t = Tensor(data)
|
||||
|
||||
Reference in New Issue
Block a user