@@ -223,7 +223,7 @@ void DeepPotPD::compute(ENERGYVTYPE& ener,
223223 sendnum_tensor->CopyFromCpu (lmp_list.sendnum );
224224 auto communicator_tensor = predictor_fl->GetInputHandle (" communicator" );
225225 communicator_tensor->Reshape ({1 });
226- if (lmp_list.world > 0 ) {
226+ if (lmp_list.world ) {
227227 communicator_tensor->CopyFromCpu (static_cast <int *>(lmp_list.world ));
228228 }
229229 int total_send =
@@ -244,14 +244,16 @@ void DeepPotPD::compute(ENERGYVTYPE& ener,
244244 for (size_t ii = 0 ; ii < nall_real; ii++) {
245245 mapping[ii] = lmp_list.mapping [fwd_map[ii]];
246246 }
247+ this ->mapping_tensor = predictor_fl->GetInputHandle (" mapping" );
247248 this ->mapping_tensor ->Reshape ({1 , nall_real});
248249 this ->mapping_tensor ->CopyFromCpu (mapping.data ());
249250 }
250251 }
251252 std::vector<int > firstneigh = createNlistTensorPD (nlist_data.jlist );
252- firstneigh_tensor = predictor_fl->GetInputHandle (" nlist" );
253- firstneigh_tensor->Reshape ({1 , nloc, (int )firstneigh.size () / (int )nloc});
254- firstneigh_tensor->CopyFromCpu (firstneigh.data ());
253+ this ->firstneigh_tensor = predictor_fl->GetInputHandle (" nlist" );
254+ this ->firstneigh_tensor ->Reshape (
255+ {1 , nloc, (int )firstneigh.size () / (int )nloc});
256+ this ->firstneigh_tensor ->CopyFromCpu (firstneigh.data ());
255257 bool do_atom_virial_tensor = atomic;
256258 std::unique_ptr<paddle_infer::Tensor> fparam_tensor;
257259 if (!fparam.empty ()) {
0 commit comments