Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/tinygrad/tinygrad
/ test_const
Method
test_const
test/unit/test_callify.py:12–15 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
10
self.assertListEqual(out.tolist(), [5.0, 7.0, 9.0])
11
12
def
test_const(self):
13
out = Tensor(2.0) + Tensor(3.0)
14
out.callify()
15
self.assertEqual(out.item(), 5.0)
16
17
def
test_sum(self):
18
out = Tensor.ones(16).contiguous().sum()
Callers
nothing calls this directly
Calls
3
Tensor
Class · 0.90
callify
Method · 0.80
item
Method · 0.80
Tested by
no test coverage detected