Closed Kai-46 closed 4 years ago
Hi @Kai-46 , thanks for your question. We define the depth function as our own autograd function. This means that you have to define a forward pass as well as a backward pass, and just apply your function - the gradients are then back propagated like for any standard PyTorch autograd function. This example from the official PyTorch webpage might also be helpful.
Thanks for sharing the great work! I have a silly question regarding the implementation of depth gradient. It seems that the forward procedure of DepthFunction(torch.autograd.Function) is explicitly executed by calling DepthFunction.apply. However, I wonder how the backward procedure is called in the codebase. Any help is appreciated! Thanks.