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 @@ -597,7 +597,7 @@ def _find_solve_with_eye(node):
597
597
def rewrite_inv_inv (fgraph , node ):
598
598
valid_inverses = (MatrixInverse , MatrixPinv , Solve , SolveTriangular )
599
599
valid_solves = (Solve , SolveTriangular )
600
- # Check if Solve has b = eye
600
+ # Check if its a valid inverse operation (either inv/pinv or if its solve, then b = eye)
601
601
inv_check = False
602
602
if hasattr (node .op , "core_op" ) and isinstance (node .op .core_op , valid_inverses ):
603
603
inv_check = True
@@ -610,7 +610,8 @@ def rewrite_inv_inv(fgraph, node):
610
610
potential_inner_inv = node .inputs [0 ].owner
611
611
if potential_inner_inv is None or potential_inner_inv .op is None :
612
612
return None
613
- # Check if its an inner solve as well, does that have b = eye
613
+
614
+ # Check if its a valid inverse operation (either inv/pinv or if its solve, then b = eye)
614
615
inv_check = False
615
616
if hasattr (potential_inner_inv .op , "core_op" ) and isinstance (
616
617
potential_inner_inv .op .core_op , valid_inverses
You can’t perform that action at this time.
0 commit comments