6f34f74e9b
date: 2026-04-10T22:07:44 master commit: 4ba0c4b574bff994e9a8f7266b4969b39380a8b1
17 lines
436 B
Python
17 lines
436 B
Python
from tinygrad.tensor import Tensor
|
|
import numpy as np
|
|
import pickle
|
|
import unittest
|
|
|
|
class TestToNumpy(unittest.TestCase):
|
|
def test_numpy_is_numpy(self):
|
|
output = Tensor.ones((1, 3, 4096)).realize().numpy()
|
|
new = np.copy(output)
|
|
print(type(new))
|
|
serialized = pickle.dumps(new)
|
|
out = pickle.loads(serialized)
|
|
assert out.shape == (1,3,4096)
|
|
assert (out==1).all()
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main() |