Optimizations in lazy.py (#987)

* optimizations in lazy.py

* make mypy happy with stubs and fix the graph import hack

* merge conflict in helpers.py
This commit is contained in:
Rayan Hatout
2023-06-26 21:55:42 +01:00
committed by GitHub
parent 8bea6b6d35
commit dedbd970aa
9 changed files with 387 additions and 244 deletions

View File

@@ -186,8 +186,7 @@ class TestTinygrad(unittest.TestCase):
# assert Tensor.randn(1,0,2,5) == 0 # TODO: fix empty tensors
def test_element_size(self):
for f in dataclasses.fields(dtypes):
dtype = f.default
for _, dtype in dtypes.fields().items():
assert dtype.itemsize == Tensor.randn(3, dtype=dtype).element_size(), f"Tensor.element_size() not matching Tensor.dtype.itemsize for {dtype}"
if __name__ == '__main__':