Thanks for the reply, @ptrblck . It would be great if the for loop can be avoided. The list of tensors used is below:
ndof    = 120000
tne     = 80000
u       = torch.rand(ndof)
elems   = torch.rand((tne, 8))
nodes   = torch.rand((ndof//3, 3))
elnodes = torch.rand(8)
xcel    = torch.rand(8)
ycel    = torch.rand(8)
zcel    = torch.rand(8)
dof     = torch.rand(24)
u_el    = torch.rand(24)
strain  = torch.rand((8, 6))
stress  = torch.rand((8, 6))
Fint_e  = torch.rand((24, 1))
Fext_e  = torch.rand((24, 1))
Fint    = torch.rand((ndof, 1))
Fext    = torch.rand((ndof, 1))

Thanks in advance