We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bce3d5 commit 3f85e50Copy full SHA for 3f85e50
pytensor/tensor/rewriting/math.py
@@ -552,13 +552,15 @@ def local_sqrt_sqr(fgraph, node):
552
return [new_out]
553
554
555
-@register_canonicalize
+@register_specialize
556
@node_rewriter([log])
557
def local_log_sqrt(fgraph, node):
558
x = node.inputs[0]
559
560
- if not (x.owner and isinstance(x.owner.op, Elemwise)) and isinstance(
561
- x.owner.op.scalar_op, ps.Sqrt
+ if (
+ not x.owner
562
+ or not isinstance(x.owner.op, Elemwise)
563
+ or not isinstance(x.owner.op.scalar_op, ps.Sqrt)
564
):
565
return
566
0 commit comments