Skip to content

Commit 0a0264f

Browse files
wanghan-iapcmHan Wang
authored andcommitted
fix: data type of nloc, nall-nloc in the input of border_op (#4653)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> - **Refactor** - Updated internal processing to explicitly assign certain computational operations to run on the CPU. This change clarifies execution behavior and enhances consistency in data handling while preserving all existing functionalities for end-users. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Han Wang <wang_han@iapcm.ac.cn> (cherry picked from commit d040d08) Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
1 parent 092a2f9 commit 0a0264f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

deepmd/pt/model/descriptor/repformers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,13 +491,13 @@ def forward(
491491
torch.tensor(
492492
real_nloc,
493493
dtype=torch.int32,
494-
device=env.DEVICE,
495-
), # should be int of c++
494+
device=torch.device("cpu"),
495+
), # should be int of c++, placed on cpu
496496
torch.tensor(
497497
real_nall - real_nloc,
498498
dtype=torch.int32,
499-
device=env.DEVICE,
500-
), # should be int of c++
499+
device=torch.device("cpu"),
500+
), # should be int of c++, placed on cpu
501501
)
502502
g1_ext = ret[0].unsqueeze(0)
503503
if has_spin:

0 commit comments

Comments
 (0)