MCPcopy
hub / github.com/tinygrad/tinygrad / test_get_shape

Method test_get_shape

test/null/test_helpers.py:346–351  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

344
345class TestGetShape(unittest.TestCase):
346 def test_get_shape(self):
347 assert get_shape(2) == ()
348 assert get_shape([]) == (0,)
349 assert get_shape([[]]) == (1, 0)
350 assert get_shape([[1, 2]]) == (1, 2)
351 assert get_shape([[1, 2], (3, 4)]) == (2, 2)
352
353 def test_inhomogeneous_shape(self):
354 with self.assertRaises(ValueError): get_shape([[], [1]])

Callers

nothing calls this directly

Calls 1

get_shapeFunction · 0.90

Tested by

no test coverage detected