mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-23 18:42:10 +08:00
13aee3754b
date: 2026-07-20T11:52:50
master commit: bae7e49626
27 lines
686 B
Python
27 lines
686 B
Python
import unittest
|
|
from tinygrad import Tensor
|
|
|
|
class TestLoadStore(unittest.TestCase):
|
|
def test_load_shape(self):
|
|
t = Tensor(bytes(16)).fs_load(1024)
|
|
assert t.shape == (1024,), t.shape
|
|
t.schedule_linear()
|
|
|
|
def test_store_shape(self):
|
|
t = Tensor.zeros(1024).fs_store()
|
|
assert t.shape == (16,), t.shape
|
|
t.schedule_linear()
|
|
|
|
def test_load_large_shape(self):
|
|
t = Tensor(bytes(16)).fs_load(10_000_000)
|
|
assert t.shape == (10_000_000,), t.shape
|
|
t.schedule_linear()
|
|
|
|
def test_store_large_shape(self):
|
|
t = Tensor.zeros(10_000_000).fs_store()
|
|
assert t.shape == (16,), t.shape
|
|
t.schedule_linear()
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|