Skip to content

Commit dac64cf

Browse files
wanghan-iapcmHan Wang
andauthored
input order of env_mat changed to be consistent with descriptor (#3125)
Co-authored-by: Han Wang <[email protected]>
1 parent 438bc78 commit dac64cf

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

deepmd_utils/model_format/env_mat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ def __init__(
6868

6969
def call(
7070
self,
71-
nlist: np.ndarray,
7271
coord_ext: np.ndarray,
7372
atype_ext: np.ndarray,
73+
nlist: np.ndarray,
7474
davg: Optional[np.ndarray] = None,
7575
dstd: Optional[np.ndarray] = None,
7676
) -> Union[np.ndarray, np.ndarray]:

deepmd_utils/model_format/se_e2_a.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def call(
137137
The descriptor. shape: nf x nloc x ng x axis_neuron
138138
"""
139139
# nf x nloc x nnei x 4
140-
rr, ww = self.env_mat.call(nlist, coord_ext, atype_ext, self.davg, self.dstd)
140+
rr, ww = self.env_mat.call(coord_ext, atype_ext, nlist, self.davg, self.dstd)
141141
nf, nloc, nnei, _ = rr.shape
142142
sec = np.append([0], np.cumsum(self.sel))
143143

source/tests/test_model_format_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ def test_self_consistency(
192192
dstd = 0.1 + np.abs(dstd)
193193
em0 = EnvMat(self.rcut, self.rcut_smth)
194194
em1 = EnvMat.deserialize(em0.serialize())
195-
mm0, ww0 = em0.call(self.nlist, self.coord_ext, self.atype_ext, davg, dstd)
196-
mm1, ww1 = em1.call(self.nlist, self.coord_ext, self.atype_ext, davg, dstd)
195+
mm0, ww0 = em0.call(self.coord_ext, self.atype_ext, self.nlist, davg, dstd)
196+
mm1, ww1 = em1.call(self.coord_ext, self.atype_ext, self.nlist, davg, dstd)
197197
np.testing.assert_allclose(mm0, mm1)
198198
np.testing.assert_allclose(ww0, ww1)
199199

0 commit comments

Comments
 (0)