How to calculate L1 loss between two variables?

Thanks. I solved this problem by:

err = torch.mean(torch.abs(err_a - err_b))
err.backward( )
1 Like