Files
tinygrad/test/unit/test_helpers.py
George Hotz d59e6e7a37 move more tests to test/null, split some existing ones (#14512)
* move more tests to test/null, split some existing ones

* null work

* null work

* move more

* fixes

* move PIL

* PIL in CLIP

* don't move that
2026-02-03 20:20:20 +08:00

16 lines
489 B
Python

import unittest
import numpy as np
from tinygrad.helpers import polyN, is_numpy_ndarray
from tinygrad.tensor import Tensor
class TestPolyN(unittest.TestCase):
def test_tensor(self):
np.testing.assert_allclose(polyN(Tensor([1.0, 2.0, 3.0, 4.0]), [1.0, -2.0, 1.0]).numpy(), [0.0, 1.0, 4.0, 9.0])
class TestIsNumpyNdarray(unittest.TestCase):
def test_tensor_numpy(self):
self.assertTrue(is_numpy_ndarray(Tensor([1, 2, 3]).numpy()))
if __name__ == '__main__':
unittest.main()