Thanks so much! This certainly works for very simple models but I agree is extremely cumbersome for larger ones. Do you know why it is that nn.Parameters don’t retain the gradient of the tensors which are used to create then?