diff --git a/deepmd/pt/loss/tensor.py b/deepmd/pt/loss/tensor.py index 2436b3bc6e..e0cf229e74 100644 --- a/deepmd/pt/loss/tensor.py +++ b/deepmd/pt/loss/tensor.py @@ -85,7 +85,7 @@ def forward(self, model_pred, label, natoms, learning_rate=0.0, mae=False): del learning_rate, mae loss = torch.tensor.zeros( 1, dtype=env.GLOBAL_PT_FLOAT_PRECISION, device=env.DEVICE - ) + )[0] more_loss = {} if ( self.has_local_weight