I’m using pytorch 1.8.1. As I’m running a testcase in test_autograd.py, e.g. addcmul. I see there is a gradgradcheck to check the second order derivatives. I just want to know how the backward is done.
So I used torchviz to generate the backward graph below:
addcmul1106×791 44.6 KB
(This graph is generated in an pytorch 1.9 environment)
So, I guess these are the called backward functions, right? I want to know how MulBackward1 is done in pytorch c/cuda source code. But I greped and only found it here:build/lib.linux-x86_64-3.6/torch/include/torch/csrc/autograd/generated/Functions.h.(And from the directory hierachy, it seems this file is auto generated, maybe from some macros?) So it’s superclass is TraceableFunction and the superclass of that is Node. But I cann’t find anything like how MulBackward1 is implemented, like an op. Or am I looking into the wrong direction?