Skip to content

Commit d77b37a

Browse files
Copilotgramalingam
andcommitted
Use direct attribute check in tutorial example
Co-authored-by: gramalingam <10075881+gramalingam@users.noreply.github.com>
1 parent c2fb43c commit d77b37a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/tutorial/rewriter/conditional_rewrite.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,8 @@ def advanced_condition_check(context, x, y, **_):
7777
main_node = context.main_root_node
7878

7979
# Check that the main_node does not have an attribute called "alpha"
80-
for attr in main_node.attribute:
81-
if attr.name == "alpha":
82-
return False
80+
if "alpha" in main_node.attributes:
81+
return False
8382

8483
# Access the broader graph context and check that x occurs as a graph-input
8584
model = context.model

0 commit comments

Comments
 (0)