Solved by InnovArul in post #4 
              
              
                use 
grad_seq = [torch.tensor(1.0).cuda(gpu) for _ in range(len(loss_seq))]

The whole idea is to use torch.tensor to create a zero-dimensional tensor containing 1.0.