File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
pytensor/tensor/rewriting Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -567,7 +567,7 @@ def _find_solve_with_eye(node):
567
567
def rewrite_inv_inv (fgraph , node ):
568
568
valid_inverses = (MatrixInverse , MatrixPinv , Solve , SolveTriangular )
569
569
valid_solves = (Solve , SolveTriangular )
570
- # Check if Solve has b = eye
570
+ # Check if its a valid inverse operation (either inv/pinv or if its solve, then b = eye)
571
571
inv_check = False
572
572
if hasattr (node .op , "core_op" ) and isinstance (node .op .core_op , valid_inverses ):
573
573
inv_check = True
@@ -580,7 +580,8 @@ def rewrite_inv_inv(fgraph, node):
580
580
potential_inner_inv = node .inputs [0 ].owner
581
581
if potential_inner_inv is None or potential_inner_inv .op is None :
582
582
return None
583
- # Check if its an inner solve as well, does that have b = eye
583
+
584
+ # Check if its a valid inverse operation (either inv/pinv or if its solve, then b = eye)
584
585
inv_check = False
585
586
if hasattr (potential_inner_inv .op , "core_op" ) and isinstance (
586
587
potential_inner_inv .op .core_op , valid_inverses
You can’t perform that action at this time.
0 commit comments