MCPcopy Index your code
hub / github.com/tinygrad/tinygrad / test_gradient

Method test_gradient

test/backend/test_multitensor.py:46–50  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

44 (X + X).realize()
45
46 def test_gradient(self):
47 X = Tensor.ones(256).contiguous().realize()
48 X.to_(devices_2)
49 grad = X.sum().gradient(X)[0]
50 grad.realize()
51
52 def test_shard(self):
53 X = Tensor.ones(256).contiguous().realize()

Callers

nothing calls this directly

Calls 6

realizeMethod · 0.80
to_Method · 0.80
gradientMethod · 0.80
sumMethod · 0.80
contiguousMethod · 0.45
onesMethod · 0.45

Tested by

no test coverage detected