Skip to content

Commit 7dbef95

Browse files
Copilotxieofxie
andauthored
refactor: auto-generate pattern_id from class name using type(self).__name__
Agent-Logs-Url: https://github.com/microsoft/WinML-ModelKit/sessions/4e081533-7e72-43b5-abeb-ac25eec7070e Co-authored-by: xieofxie <2876650+xieofxie@users.noreply.github.com>
1 parent b0a7598 commit 7dbef95

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/winml/modelkit/pattern/transpose_patterns.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ def check_skeleton_result(
314314

315315
@property
316316
def pattern_id(self) -> str:
317-
"""Return pattern ID matching the information rule configuration."""
318-
return "SUBGRAPH/ReshapeTransposeReshapeOverlyHighDimPattern"
317+
"""Return pattern ID derived from the class name."""
318+
return f"SUBGRAPH/{type(self).__name__}"
319319

320320
def get_schema(self) -> PatternSchema:
321321
"""Return the schema definition for ReshapeTransposeReshape pattern.
@@ -616,8 +616,8 @@ def get_internal_constants_and_attributes(
616616

617617
@property
618618
def pattern_id(self) -> str:
619-
"""Return pattern ID matching the information rule configuration."""
620-
return "SUBGRAPH/ReshapeTransposeReshapeLowDimPattern"
619+
"""Return pattern ID derived from the class name."""
620+
return f"SUBGRAPH/{type(self).__name__}"
621621

622622
def get_schema(self) -> PatternSchema:
623623
"""Return the schema definition for ReshapeTransposeReshapeLowDim pattern."""

0 commit comments

Comments
 (0)