24/31
Part 5 of 6 · A Linear layer, proved by gradcheckLearn and do

Run it in float64

The nudge is tiny, so precision decides whether the check works.

a32 = a.detach().float().requires_grad_()
b32 = b.detach().float().requires_grad_()
print(torch.autograd.gradcheck(MatMul.apply, (a32, b32), raise_exception=False))
Predict

Run the same gradcheck on float32 copies of a and b. What does it return?

Pick one to see what it prints.
Pick an answer above to see the rest