Skip to content

Commit 20b6a20

Browse files
committed
Do not emmit confusing warning from FusionOptimizer by default
1 parent ec45e25 commit 20b6a20

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pytensor/tensor/rewriting/elemwise.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -699,12 +699,10 @@ def elemwise_scalar_op_has_c_code(node: Apply) -> bool:
699699
if node.op.scalar_op.supports_c_code(node.inputs, node.outputs):
700700
return True
701701
else:
702-
warn(
703-
"Optimization Warning: "
704-
f"The Op {node.op.scalar_op} does not provide a C implementation."
705-
" As well as being potentially slow, this also disables "
706-
"loop fusion."
707-
)
702+
if config.optimizer_verbose:
703+
warn(
704+
f"Loop fusion interrupted because {node.op.scalar_op} does not provide a C implementation."
705+
)
708706
return False
709707

710708
# Fuseable nodes have to be accessed in a deterministic manner

0 commit comments

Comments
 (0)