mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-07 03:00:26 -04:00
ban __bool__ on Tensor (#3632)
* ban __bool__ on Tensor avoid misuse * test case * fix tests * fix more tests
This commit is contained in:
@@ -124,7 +124,7 @@ class TestSafetensors(unittest.TestCase):
|
||||
path = temp(f"ones.{dtype}.safetensors")
|
||||
ones = Tensor.rand((10,10), dtype=dtype)
|
||||
safe_save(get_state_dict(ones), path)
|
||||
assert ones == list(safe_load(path).values())[0]
|
||||
np.testing.assert_equal(ones.numpy(), list(safe_load(path).values())[0].numpy())
|
||||
|
||||
def test_load_supported_types(self):
|
||||
import torch
|
||||
|
||||
Reference in New Issue
Block a user