From 9b6042b2fba7ba5f9c310c49db5bdb4308499d6e Mon Sep 17 00:00:00 2001 From: Anyang Peng <137014849+anyangml@users.noreply.github.com> Date: Mon, 18 Mar 2024 11:09:43 +0800 Subject: [PATCH] Fix: Invar_fitting warning msg (#3485) This should fix #3476 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- deepmd/pt/model/task/invar_fitting.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/deepmd/pt/model/task/invar_fitting.py b/deepmd/pt/model/task/invar_fitting.py index 1699b440ac..afb1d73658 100644 --- a/deepmd/pt/model/task/invar_fitting.py +++ b/deepmd/pt/model/task/invar_fitting.py @@ -167,11 +167,7 @@ def compute_output_stats( bias_atom_e = compute_output_stats( merged, self.ntypes, stat_file_path, self.rcond, self.atom_ener ) - self.bias_atom_e.copy_( - torch.tensor(bias_atom_e, device=env.DEVICE).view( - [self.ntypes, self.dim_out] - ) - ) + self.bias_atom_e.copy_(bias_atom_e.view([self.ntypes, self.dim_out])) def output_def(self) -> FittingOutputDef: return FittingOutputDef(