Solved by tom in post #3 
              
              
                It’s generated during the build in torch/csrc/autograd/generated. In Functions.cpp: 
variable_list MulBackward1::apply(variable_list&& grads) {
  IndexRangeGenerator gen;
  auto self_ix = gen.range(1);
  variable_list grad_inputs(gen.size());
  auto& grad = grads[0];
  bool any_grad_defined = any_v…