Skip to content

Commit b28ccb1

Browse files
authored
Remove temporary output file in DeePKS. (#7276)
* Remove temporary output file in DeePKS. * Remove some useless code.
1 parent 1735845 commit b28ccb1

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

source/source_lcao/module_deepks/deepks_basic.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,8 @@ void DeePKS_domain::cal_edelta_gedm(const int nat,
244244
}
245245
E_delta = ec[0].item<double>() * 2; // Ry; *2 is for Hartree to Ry
246246

247-
// get d ec[0]/d inputs
248-
// inputs: [1, nat, des_per_atom]
249247
// ec: [1, 1]
250-
std::vector<torch::Tensor> tensor_inputs;
251-
tensor_inputs.push_back(inputs[0].toTensor());
252248
ec[0].reshape({1, 1}).requires_grad_(true);
253-
torch::Tensor derivative = torch::autograd::grad(ec, tensor_inputs, {}, true)[0];
254-
LCAO_deepks_io::save_tensor2npy<double>("gev.npy",
255-
derivative.reshape({nat, deepks_param.des_per_atom}),
256-
0); // dm_eig.npy is the input for gedm
257249

258250
// cal gedm
259251
std::vector<torch::Tensor> gedm_shell;

0 commit comments

Comments
 (0)