Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:
exclude: ^source/3rdparty
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.15.8
rev: v0.15.9
hooks:
- id: ruff
args: ["--fix"]
Expand Down
10 changes: 5 additions & 5 deletions deepmd/tf/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def filter(self, record: logging.LogRecord) -> bool:
# \3: layer index
# The rest: types of neighbor atoms
# IMPORTANT: the order is critical to match the pattern
EMBEDDING_NET_PATTERN = str(
EMBEDDING_NET_PATTERN = (
r"filter_type_(\d+)/(matrix)_(\d+)_(\d+)|"
r"filter_type_(\d+)/(bias)_(\d+)_(\d+)|"
r"filter_type_(\d+)/(idt)_(\d+)_(\d+)|"
Expand All @@ -157,7 +157,7 @@ def filter(self, record: logging.LogRecord) -> bool:
# \1: layer index or "final"
# \2: type of centeral atom, optional
# the last: weight name
FITTING_NET_PATTERN = str(
FITTING_NET_PATTERN = (
r"layer_(\d+)/(matrix)|"
r"layer_(\d+)_type_(\d+)/(matrix)|"
r"layer_(\d+)/(bias)|"
Expand All @@ -182,13 +182,13 @@ def filter(self, record: logging.LogRecord) -> bool:
# subpatterns:
# \1: weight name
# \2: layer index
TYPE_EMBEDDING_PATTERN = str(
TYPE_EMBEDDING_PATTERN = (
r"type_embed_net/(matrix)_(\d+)|"
r"type_embed_net/(bias)_(\d+)|"
r"type_embed_net/(idt)_(\d+)|"
)[:-1]

ATTENTION_LAYER_PATTERN = str(
ATTENTION_LAYER_PATTERN = (
r"attention_layer_(\d+)/(c_query)/(matrix)|"
r"attention_layer_(\d+)/(c_query)/(bias)|"
r"attention_layer_(\d+)/(c_key)/(matrix)|"
Expand All @@ -207,7 +207,7 @@ def filter(self, record: logging.LogRecord) -> bool:
EMBEDDING_NET_PATTERN
+ FITTING_NET_PATTERN
+ TYPE_EMBEDDING_PATTERN
+ str(
+ (
r"descrpt_attr/t_avg|"
r"descrpt_attr/t_std|"
r"fitting_attr/t_fparam_avg|"
Expand Down
Loading