MCPcopy
hub / github.com/tinygrad/tinygrad / test_softmax_backward

Method test_softmax_backward

test/null/test_schedule.py:808–812  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

806 self.assertEqual(linear.src[2].src[1].dtype, dtypes.float)
807
808 def test_softmax_backward(self):
809 Tensor.manual_seed(0)
810 x = Tensor.randn(4, 12, 64, 64).realize()
811 x.softmax().sum().backward()
812 run_linear(*check_schedule(x.grad, 4))
813
814 def test_scaled_dot_product_attention_fusion(self):
815 x, y, z, m = (Tensor.empty(32, 8, 16, 16) for _ in range(4))

Callers

nothing calls this directly

Calls 8

run_linearFunction · 0.90
manual_seedMethod · 0.80
realizeMethod · 0.80
randnMethod · 0.80
sumMethod · 0.80
softmaxMethod · 0.80
check_scheduleFunction · 0.70
backwardMethod · 0.45

Tested by

no test coverage detected