Skip to content

Commit f9d18d6

Browse files
committed
fix typos
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
1 parent f02db7f commit f9d18d6

6 files changed

Lines changed: 16 additions & 16 deletions

File tree

deepmd/dpmodel/descriptor/dpa1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,10 +896,10 @@ def compute_input_stats(
896896
env_mat_stat.load_or_compute_stats(sampled, path)
897897
self.stats = env_mat_stat.stats
898898
mean, stddev = env_mat_stat()
899-
xp = array_api_compat.array_namespace(self.dstd)
899+
xp = array_api_compat.array_namespace(self.stddev)
900900
if not self.set_davg_zero:
901-
self.davg = xp.asarray(mean, dtype=self.davg.dtype, copy=True)
902-
self.dstd = xp.asarray(stddev, dtype=self.dstd.dtype, copy=True)
901+
self.mean = xp.asarray(mean, dtype=self.mean.dtype, copy=True)
902+
self.stddev = xp.asarray(stddev, dtype=self.stddev.dtype, copy=True)
903903

904904
def get_stats(self) -> dict[str, StatItem]:
905905
"""Get the statistics of the descriptor."""

deepmd/dpmodel/descriptor/repflows.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,10 @@ def compute_input_stats(
385385
env_mat_stat.load_or_compute_stats(sampled, path)
386386
self.stats = env_mat_stat.stats
387387
mean, stddev = env_mat_stat()
388-
xp = array_api_compat.array_namespace(self.dstd)
388+
xp = array_api_compat.array_namespace(self.stddev)
389389
if not self.set_davg_zero:
390-
self.davg = xp.asarray(mean, dtype=self.davg.dtype, copy=True)
391-
self.dstd = xp.asarray(stddev, dtype=self.dstd.dtype, copy=True)
390+
self.mean = xp.asarray(mean, dtype=self.mean.dtype, copy=True)
391+
self.stddev = xp.asarray(stddev, dtype=self.stddev.dtype, copy=True)
392392

393393
def get_stats(self) -> dict[str, StatItem]:
394394
"""Get the statistics of the descriptor."""

deepmd/dpmodel/descriptor/repformers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,10 @@ def compute_input_stats(
406406
env_mat_stat.load_or_compute_stats(sampled, path)
407407
self.stats = env_mat_stat.stats
408408
mean, stddev = env_mat_stat()
409-
xp = array_api_compat.array_namespace(self.dstd)
409+
xp = array_api_compat.array_namespace(self.stddev)
410410
if not self.set_davg_zero:
411-
self.davg = xp.asarray(mean, dtype=self.davg.dtype, copy=True)
412-
self.dstd = xp.asarray(stddev, dtype=self.dstd.dtype, copy=True)
411+
self.mean = xp.asarray(mean, dtype=self.mean.dtype, copy=True)
412+
self.stddev = xp.asarray(stddev, dtype=self.stddev.dtype, copy=True)
413413

414414
def get_stats(self) -> dict[str, StatItem]:
415415
"""Get the statistics of the descriptor."""

deepmd/dpmodel/descriptor/se_t_tebd.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,10 +682,10 @@ def compute_input_stats(
682682
env_mat_stat.load_or_compute_stats(sampled, path)
683683
self.stats = env_mat_stat.stats
684684
mean, stddev = env_mat_stat()
685-
xp = array_api_compat.array_namespace(self.dstd)
685+
xp = array_api_compat.array_namespace(self.stddev)
686686
if not self.set_davg_zero:
687-
self.davg = xp.asarray(mean, dtype=self.davg.dtype, copy=True)
688-
self.dstd = xp.asarray(stddev, dtype=self.dstd.dtype, copy=True)
687+
self.mean = xp.asarray(mean, dtype=self.mean.dtype, copy=True)
688+
self.stddev = xp.asarray(stddev, dtype=self.stddev.dtype, copy=True)
689689

690690
def get_stats(self) -> dict[str, StatItem]:
691691
"""Get the statistics of the descriptor."""

deepmd/dpmodel/utils/env_mat_stat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def iter(
185185
(1, coord.shape[0] * coord.shape[1], -1),
186186
)
187187
# shape: (ntypes, nloc, nnei)
188-
type_idx = xp.logical_and(type_idx.unsqueeze(-1), exclude_mask)
188+
type_idx = xp.logical_and(type_idx[..., None], exclude_mask)
189189
for type_i in range(self.descriptor.get_ntypes()):
190190
dd = env_mat[type_idx[type_i, ...]]
191191
dd = xp.reshape(

source/tests/consistent/descriptor/test_se_e2_a.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,9 @@ def eval_pd(self, pd_obj: Any) -> Any:
530530
[
531531
{
532532
"r0": None,
533-
"coord": paddle.to_tensor(self.coords)
534-
.reshape(-1, self.natoms[0], 3)
535-
.to(PD_DEVICE),
533+
"coord": paddle.to_tensor(
534+
self.coords.reshape(-1, self.natoms[0], 3)
535+
).to(PD_DEVICE),
536536
"atype": paddle.to_tensor(self.atype.reshape(1, -1)).to(PD_DEVICE),
537537
"box": paddle.to_tensor(self.box.reshape(1, 3, 3)).to(PD_DEVICE),
538538
"natoms": self.natoms[0],

0 commit comments

Comments
 (0)