MCPcopy
hub / github.com/tinygrad/tinygrad / test_symbolic

Method test_symbolic

test/test_tiny.py:98–103  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

96 # *** symbolic (to allow less recompilation) ***
97
98 def test_symbolic(self):
99 i = Variable('i', 1, 10)
100 ones = Tensor.ones(10).contiguous()
101 for s in [2,5]:
102 ret = ones[:i.bind(s)] + 1
103 self.assertListEqual(ret.contiguous()[:s].tolist(), [2.0]*s)
104
105 def test_symbolic_reduce(self):
106 i = Variable('i', 1, 10)

Callers

nothing calls this directly

Calls 5

VariableFunction · 0.50
contiguousMethod · 0.45
onesMethod · 0.45
bindMethod · 0.45
tolistMethod · 0.45

Tested by

no test coverage detected