Skip to content

Commit

Permalink
fix pt bug: missing get_ntype method (#3612)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
CaRoLZhangxy and pre-commit-ci[bot] authored Mar 27, 2024
1 parent c1f22b5 commit f5b7aa3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions deepmd/pt/model/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ def compute_or_load_stat(
def get_model_def_script(self) -> str:
"""Get the model definition script."""
return self.model_def_script

@torch.jit.export
def get_ntypes(self):
"""Returns the number of element types."""
return len(self.get_type_map())

0 comments on commit f5b7aa3

Please sign in to comment.