Closed FightForCS closed 5 years ago
Hi FightForCS, This is a really good question! Actually I don't know using Variable.data can be directly used to build the graph (and I still doubt that, especially when the code involves some counting by visibility operation). For me, I just directly translate my luaTorch code (https://github.com/xingyizhou/pose-hg-3d/blob/master/src/models/layers/VarCriterion.lua#L56) to python.
Hi, thanks for your great work. May I ask why do you write FusionCriterion function with forward pass and backward pass on your own? As far as I know, the forward pass is already differentiable, Pytorch itself can handle the backward pass, right? Is there something important that I was missing? In this link https://discuss.pytorch.org/t/how-to-use-condition-flow/644/3 , using Variable.data is still a safe operation in building a graph. Looking for your reply, Thanks.