This tutorial 1 explains how to write custom autograd.Fucntions.



 TheOraware:

Still i am not clear if i write following code framework to train neural network then how could it be break? Calculating gradients loss.backward and update weights optimizer.step are builtin in pytorch how come it will break? Are you talking about changes made by pytroch team within new package/release of pytorch?


If you are “just using” built-in PyTorch methods, you are most likely not interested in testing utilities.
Yes, since PyTorch is an open source framework with a lot of active developers, things can accidentally break, which is why testing is needed.