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):
5050 props = op ._props_dict ()
5151 props ["inplace" ] = True
5252 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
5457
5558 return False
5659
Original file line number Diff line number Diff line change 99from pytensor .compile .mode import Mode
1010from pytensor .graph .basic import Constant , Variable , ancestors
1111from pytensor .graph .fg import FunctionGraph
12- from pytensor .graph .rewriting .basic import EquilibriumGraphRewriter
12+ from pytensor .graph .rewriting .basic import EquilibriumGraphRewriter , check_stack_trace
1313from pytensor .graph .rewriting .db import RewriteDatabaseQuery
1414from pytensor .tensor import constant
1515from pytensor .tensor .elemwise import DimShuffle
@@ -143,6 +143,7 @@ def test_inplace_rewrites(rv_op):
143143 for a , b in zip (new_op .dist_params (new_node ), op .dist_params (node ))
144144 )
145145 assert np .array_equal (new_op .size_param (new_node ).data , op .size_param (node ).data )
146+ assert check_stack_trace (f )
146147
147148
148149@config .change_flags (compute_test_value = "raise" )
You can’t perform that action at this time.
0 commit comments