Skip to content

Commit 06cc53d

Browse files
authored
Merge pull request #822 from wenfei-li/develop
deepks : allow reading embedding model
2 parents 4a0b03a + e2fc3ed commit 06cc53d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/module_deepks/LCAO_deepks_torch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ void LCAO_Deepks::cal_gedm(const int nat)
293293
std::vector<torch::jit::IValue> inputs;
294294

295295
//input_dim:(natom, des_per_atom)
296-
inputs.push_back(torch::cat(this->d_tensor, 0).reshape({ nat, this->des_per_atom }));
296+
inputs.push_back(torch::cat(this->d_tensor, 0).reshape({ 1, nat, this->des_per_atom }));
297297
std::vector<torch::Tensor> ec;
298298
ec.push_back(module.forward(inputs).toTensor()); //Hartree
299299
this->E_delta = ec[0].item().toDouble() * 2;//Ry; *2 is for Hartree to Ry
@@ -502,4 +502,4 @@ void LCAO_Deepks::cal_orbital_precalc(const std::vector<ModuleBase::matrix> &dm_
502502
return;
503503
}
504504

505-
#endif
505+
#endif

0 commit comments

Comments
 (0)