MCPcopy
hub / github.com/tinygrad/tinygrad / test_uniform_gradient

Method test_uniform_gradient

test/null/test_gradient.py:77–80  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

75 assert x.uop.is_realized
76
77 def test_uniform_gradient(self):
78 x = Tensor.uniform(16, 3, 3, 3).realize()
79 y = x * 2
80 y.sum().gradient(x)[0].realize()
81
82if __name__ == '__main__':
83 unittest.main()

Callers

nothing calls this directly

Calls 4

realizeMethod · 0.80
uniformMethod · 0.80
gradientMethod · 0.80
sumMethod · 0.80

Tested by

no test coverage detected