Skip to content

Commit 8c96856

Browse files
Add destroy_map to LU op
1 parent be908d4 commit 8c96856

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pytensor/tensor/slinalg.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def __init__(
425425
self.gufunc_signature = "(m,m)->(m,m),(m,m),(m,m)"
426426

427427
if self.overwrite_a:
428-
self.destroy_map = {0: [0]}
428+
self.destroy_map = {0: [0]} if self.permute_l else {1: [0]}
429429

430430
def infer_shape(self, fgraph, node, shapes):
431431
n = shapes[0][0]
@@ -482,6 +482,7 @@ def inplace_on_inputs(self, allowed_inplace_inputs: list[int]) -> "Op":
482482
new_props = self._props_dict() # type: ignore
483483
new_props["overwrite_a"] = True
484484
return type(self)(**new_props)
485+
485486
else:
486487
return self
487488

0 commit comments

Comments
 (0)