Skip to content

Commit 9f9bc8b

Browse files
author
Luca Citi
committed
Fixed bug where I forgot to check whether result of is_neg was None or not before proceeding
1 parent 92a29d2 commit 9f9bc8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytensor/tensor/rewriting/math.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3605,7 +3605,7 @@ def logmexpm1_to_log1mexp(fgraph, node):
36053605
if node.op == log:
36063606
(log_arg,) = node.inputs
36073607
neg_arg = is_neg(log_arg)
3608-
if neg_arg.owner and neg_arg.owner.op == expm1:
3608+
if neg_arg is not None and neg_arg.owner and neg_arg.owner.op == expm1:
36093609
(expm1_arg,) = neg_arg.owner.inputs
36103610
rewrites[node.outputs[0]] = log1mexp(expm1_arg)
36113611
return rewrites

0 commit comments

Comments
 (0)