Skip to content

Commit e2f54c8

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 8bce829 commit e2f54c8

2 files changed

Lines changed: 8 additions & 14 deletions

File tree

deepmd/pt_expt/model/get_model.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
TYPE_CHECKING,
1313
)
1414

15-
from deepmd.dpmodel.atomic_model.dp_atomic_model import (
16-
DPAtomicModel as DPAtomicModelDP,
17-
)
15+
from deepmd.dpmodel.atomic_model.dp_atomic_model import DPAtomicModel as DPAtomicModelDP
1816
from deepmd.dpmodel.atomic_model.inner_potential import (
1917
InnerPotentialAtomicModel as InnerPotentialAtomicModelDP,
2018
)
@@ -24,12 +22,12 @@
2422
from deepmd.dpmodel.model.model_factory import (
2523
BackendModelFactory,
2624
)
27-
from deepmd.pt_expt.common import (
28-
auto_wrapped_class,
29-
)
3025
from deepmd.dpmodel.model.model_factory import (
3126
get_spin_model as get_spin_model_from_factory,
3227
)
28+
from deepmd.pt_expt.common import (
29+
auto_wrapped_class,
30+
)
3331
from deepmd.pt_expt.descriptor import (
3432
BaseDescriptor,
3533
)

source/tests/common/dpmodel/test_dpa4_frame_mixers.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -276,15 +276,11 @@ def test_focus_batched_lowering_matches_einsum_backward(kind) -> None:
276276
rng = np.random.default_rng(2026)
277277

278278
if kind == "contract":
279-
from deepmd.pt.model.descriptor.sezm_nn.grid_net import (
280-
FrameContract as PTMixer,
281-
)
279+
from deepmd.pt.model.descriptor.sezm_nn.grid_net import FrameContract as PTMixer
282280

283281
in_dim = n_frames * channels
284282
else:
285-
from deepmd.pt.model.descriptor.sezm_nn.grid_net import (
286-
FrameExpand as PTMixer,
287-
)
283+
from deepmd.pt.model.descriptor.sezm_nn.grid_net import FrameExpand as PTMixer
288284

289285
in_dim = channels
290286
pt_mod = PTMixer(
@@ -326,12 +322,12 @@ def test_focus_batched_lowering_matches_einsum_backward(kind) -> None:
326322
)
327323

328324
# the dpmodel lowering agrees on the torch namespace, gradients included
325+
import array_api_compat
326+
329327
from deepmd.dpmodel.descriptor.dpa4_nn.grid_net import (
330328
_degree_batched_matmul,
331329
)
332330

333-
import array_api_compat
334-
335331
coeff_dp = coeff.detach().clone().requires_grad_(True)
336332
dp_out = _degree_batched_matmul(
337333
array_api_compat.array_namespace(coeff_dp),

0 commit comments

Comments
 (0)