File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
pytensor/tensor/random/rewriting
tests/tensor/random/rewriting Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,10 @@ def random_make_inplace(fgraph, node):
50
50
props = op ._props_dict ()
51
51
props ["inplace" ] = True
52
52
new_op = type (op )(** props )
53
- return new_op .make_node (* node .inputs ).outputs
53
+ new_outputs = new_op .make_node (* node .inputs ).outputs
54
+ for old_out , new_out in zip (node .outputs , new_outputs ):
55
+ copy_stack_trace (old_out , new_out )
56
+ return new_outputs
54
57
55
58
return False
56
59
Original file line number Diff line number Diff line change 9
9
from pytensor .compile .mode import Mode
10
10
from pytensor .graph .basic import Constant , Variable , ancestors
11
11
from pytensor .graph .fg import FunctionGraph
12
- from pytensor .graph .rewriting .basic import EquilibriumGraphRewriter
12
+ from pytensor .graph .rewriting .basic import EquilibriumGraphRewriter , check_stack_trace
13
13
from pytensor .graph .rewriting .db import RewriteDatabaseQuery
14
14
from pytensor .tensor import constant
15
15
from pytensor .tensor .elemwise import DimShuffle
@@ -143,6 +143,7 @@ def test_inplace_rewrites(rv_op):
143
143
for a , b in zip (new_op .dist_params (new_node ), op .dist_params (node ))
144
144
)
145
145
assert np .array_equal (new_op .size_param (new_node ).data , op .size_param (node ).data )
146
+ assert check_stack_trace (f )
146
147
147
148
148
149
@config .change_flags (compute_test_value = "raise" )
You can’t perform that action at this time.
0 commit comments