6adb63b915
date: 2026-06-04T09:49:56 master commit: c0ab3550eca2e9daf197c46b7e4b24aa9637cf2e
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() |