Class DeepTensor¶
Defined in File DeepTensor.h
Class Documentation¶
-
class deepmd::DeepTensor¶
Deep Tensor.
Public Functions
-
DeepTensor()¶
Deep Tensor constructor without initialization.
-
DeepTensor(const std::string &model, const int &gpu_rank = 0, const std::string &name_scope =
"")¶ Deep Tensor constructor with initialization..
- Parameters
model – [in] The name of the frozen model file.
gpu_rank – [in] The GPU rank. Default is 0.
file_content – [in] The content of the model file. If it is not empty, DP will read from the string instead of the file.
-
void init(const std::string &model, const int &gpu_rank = 0, const std::string &name_scope =
"")¶ Initialize the Deep Tensor.
- Parameters
model – [in] The name of the frozen model file.
gpu_rank – [in] The GPU rank. Default is 0.
file_content – [in] The content of the model file. If it is not empty, DP will read from the string instead of the file.
-
void print_summary(const std::string &pre) const¶
Print the DP summary to the screen.
- Parameters
pre – [in] The prefix to each line.
-
void compute(std::vector<VALUETYPE> &value, const std::vector<VALUETYPE> &coord, const std::vector<int> &atype, const std::vector<VALUETYPE> &box)¶
Evaluate the value by using this model.
- Parameters
value – [out] The value to evalute.
coord – [in] The coordinates of atoms. The array should be of size nframes x natoms x 3.
atype – [in] The atom types. The list should contain natoms ints.
box – [in] The cell of the region. The array should be of size nframes x 9.
-
void compute(std::vector<VALUETYPE> &value, const std::vector<VALUETYPE> &coord, const std::vector<int> &atype, const std::vector<VALUETYPE> &box, const int nghost, const InputNlist &inlist)¶
Evaluate the value by using this model.
- Parameters
value – [out] The value to evalute.
coord – [in] The coordinates of atoms. The array should be of size nframes x natoms x 3.
atype – [in] The atom types. The list should contain natoms ints.
box – [in] The cell of the region. The array should be of size nframes x 9.
nghost – [in] The number of ghost atoms.
inlist – [in] The input neighbour list.
-
inline int numb_types() const¶
Get the number of types.
- Returns
The number of types.
-
inline int output_dim() const¶
Get the output dimension.
- Returns
The output dimension.
-
inline const std::vector<int> &sel_types() const¶
-
DeepTensor()¶