MCPcopy
hub / github.com/tinygrad/tinygrad / test_convert_to_cpu

Method test_convert_to_cpu

test/external/external_test_example.py:28–32  ·  view source on GitHub ↗
(self, device)

Source from the content-addressed store, hash-verified

26class TestExample(unittest.TestCase):
27 @multidevice_test
28 def test_convert_to_cpu(self, device):
29 a = Tensor([[1,2],[3,4]], device=device)
30 assert a.numpy().shape == (2,2)
31 b = a.to("CPU")
32 assert b.numpy().shape == (2,2)
33
34 @multidevice_test
35 def test_2_plus_3(self, device):

Callers

nothing calls this directly

Calls 4

numpyMethod · 0.95
toMethod · 0.95
TensorClass · 0.90
numpyMethod · 0.45

Tested by

no test coverage detected