You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
436 B
17 lines
436 B
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() |