Solved by richard in post #2 
              
              
                I’m not sure what group lasso regularization is, but if you’re asking about autograd, loss.backward() will include the (derivatives of the) lasso terms you added.