Skip to content

Commit

Permalink
fix get_ntypes
Browse files Browse the repository at this point in the history
  • Loading branch information
CaRoLZhangxy committed Mar 27, 2024
1 parent 1423750 commit 3b721c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deepmd/pt/model/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@ 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 3b721c7

Please sign in to comment.