Skip to content

Commit e30b7cc

Browse files
fix
1 parent 9ab08b8 commit e30b7cc

File tree

7 files changed

+9
-7
lines changed

7 files changed

+9
-7
lines changed

deepmd/pd/entrypoints/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def freeze(
391391
model.forward_lower,
392392
input_spec=[
393393
InputSpec([-1, -1, 3], dtype="float64", name="coord"), # extended_coord
394-
InputSpec([-1, -1], dtype="int64", name="atype"), # extended_atype
394+
InputSpec([-1, -1], dtype="int32", name="atype"), # extended_atype
395395
InputSpec([-1, -1, -1], dtype="int32", name="nlist"), # nlist
396396
InputSpec([-1, -1], dtype="int64", name="mapping"), # mapping
397397
None, # fparam

doc/third-party/ase.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ See [Environment variables](../env.md) for the runtime environment variables.
77

88
Deep potential can be set up as a calculator with ASE to obtain potential energies and forces.
99

10+
::::{tab-set}
11+
1012
:::{tab-item} TensorFlow {{ tensorflow_icon }}
1113

1214
```python
@@ -90,3 +92,5 @@ print(water.get_positions())
9092
```
9193

9294
:::
95+
96+
::::

source/api_cc/src/DeepPotPD.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,10 +383,9 @@ void DeepPotPD::compute(ENERGYVTYPE& ener,
383383
auto coord_wrapped_Tensor = predictor_fl->GetInputHandle("coord");
384384
coord_wrapped_Tensor->Reshape({1, nall_real, 3});
385385
coord_wrapped_Tensor->CopyFromCpu(coord_wrapped.data());
386-
std::vector<std::int64_t> atype_64(datype.begin(), datype.end());
387386
auto atype_Tensor = predictor_fl->GetInputHandle("atype");
388387
atype_Tensor->Reshape({1, nall_real});
389-
atype_Tensor->CopyFromCpu(atype_64.data());
388+
atype_Tensor->CopyFromCpu(datype.data());
390389
if (ago == 0) {
391390
nlist_data.copy_from_nlist(lmp_list, nall - nghost);
392391
nlist_data.shuffle_exclude_empty(fwd_map);
@@ -564,10 +563,9 @@ void DeepPotPD::compute(ENERGYVTYPE& ener,
564563
coord_wrapped_Tensor->Reshape({1, natoms, 3});
565564
coord_wrapped_Tensor->CopyFromCpu(coord_wrapped.data());
566565

567-
std::vector<std::int64_t> atype_64(atype.begin(), atype.end());
568566
auto atype_Tensor = predictor->GetInputHandle("atype");
569567
atype_Tensor->Reshape({1, natoms});
570-
atype_Tensor->CopyFromCpu(atype_64.data());
568+
atype_Tensor->CopyFromCpu(atype.data());
571569

572570
std::unique_ptr<paddle_infer::Tensor> box_Tensor;
573571
if (!box.empty()) {

source/tests/infer/deeppot_sea.forward_lower.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
-226 Bytes
Binary file not shown.

source/tests/infer/deeppot_sea.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
-226 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)