File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
pytensor/tensor/rewriting Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -580,15 +580,13 @@ def rewrite_inv_inv(fgraph, node):
580
580
return None
581
581
582
582
potential_inner_inv = node .inputs [0 ].owner
583
- if potential_inner_inv is None :
583
+ if potential_inner_inv is None or potential_inner_inv . op is None :
584
584
return None
585
585
# Check if its an inner solve as well, does that have b = eye
586
- solve_inv_check = True
587
- if potential_inner_inv .op and isinstance (potential_inner_inv .op , DimShuffle ):
588
- return None
589
- if potential_inner_inv .op .core_op and isinstance (
590
- potential_inner_inv .op .core_op , valid_solves
591
- ):
586
+ solve_inv_check = True if hasattr (potential_inner_inv .op , "core_op" ) else False
587
+ # if potential_inner_inv.op and isinstance(potential_inner_inv.op, DimShuffle):
588
+ # return None
589
+ if solve_inv_check and isinstance (potential_inner_inv .op .core_op , valid_solves ):
592
590
solve_inv_check = _find_solve_with_eye (potential_inner_inv )
593
591
if not solve_inv_check :
594
592
return None
You can’t perform that action at this time.
0 commit comments