Skip to content

Commit 2c93dcf

Browse files
committed
updated check
1 parent dba3d18 commit 2c93dcf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pytensor/tensor/rewriting/linalg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,12 +551,12 @@ def _find_solve_with_eye(node):
551551
return False
552552
# Check whether second input to solve is Eye
553553
solve_inputs = node.inputs
554-
potential_eye_input = solve_inputs[1].owner
554+
eye_input = solve_inputs[1].owner
555555

556-
if not (potential_eye_input and isinstance(potential_eye_input.op, Eye)):
556+
if not (eye_input and isinstance(eye_input.op, Eye)):
557557
return False
558558

559-
if getattr(potential_eye_input.inputs[-1], "data", -1).item() != 0:
559+
if eye_input.inputs[-1].data.item() != 0:
560560
return False
561561
return True
562562

0 commit comments

Comments
 (0)