Solved by AlphaBetaGamma96 in post #2 
              
              
                you’ll want to replace torch.tensor(comb_L) with torch.stack(comb_L) and that’ll have a grad_fn 
import torch
import numpy as np
l1= torch.ones([1],requires_grad=True)
print("l1 is ",l1)

l2= torch.zeros([1],requires_grad=True)
print("l2 is ",l2)

comb_L=[l1,l2]
print("comb_L is ",comb_L)

Total_L=t…