Skip to content

Commit aaecd79

Browse files
committed
.
1 parent a935c01 commit aaecd79

File tree

1 file changed

+14
-26
lines changed

1 file changed

+14
-26
lines changed

pytensor/tensor/rewriting/subtensor.py

+14-26
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88
import pytensor.scalar.basic as ps
99
from pytensor import compile
1010
from pytensor.compile import optdb
11-
from pytensor.graph import FunctionGraph
1211
from pytensor.graph.basic import Constant, Variable
1312
from pytensor.graph.rewriting.basic import (
14-
EquilibriumGraphRewriter,
1513
WalkingGraphRewriter,
1614
copy_stack_trace,
1715
in2out,
@@ -58,16 +56,6 @@
5856
register_specialize,
5957
register_stabilize,
6058
)
61-
from pytensor.tensor.rewriting.extremum import (
62-
local_extremum_plus_x,
63-
local_flatten_extremum,
64-
local_useless_extremum_branches,
65-
)
66-
from pytensor.tensor.rewriting.math import (
67-
local_add_canonizer,
68-
local_intdiv_by_one,
69-
local_mul_canonizer,
70-
)
7159
from pytensor.tensor.shape import (
7260
Shape,
7361
SpecifyShape,
@@ -572,20 +560,20 @@ def local_subtensor_merge(fgraph, node):
572560
out = subtens(x, *sl_ins)
573561

574562
# Eagerly clean up merged subtensor graph, which can be a mess
575-
rewriter = EquilibriumGraphRewriter(
576-
[
577-
local_extremum_plus_x,
578-
local_add_canonizer,
579-
local_mul_canonizer,
580-
local_intdiv_by_one,
581-
local_useless_extremum_branches,
582-
local_flatten_extremum,
583-
],
584-
max_use_ratio=10.0,
585-
)
586-
fg = FunctionGraph(outputs=[out], clone=False)
587-
rewriter.rewrite(fg)
588-
[out] = fg.outputs
563+
# rewriter = EquilibriumGraphRewriter(
564+
# [
565+
# local_extremum_plus_x,
566+
# local_add_canonizer,
567+
# local_mul_canonizer,
568+
# local_intdiv_by_one,
569+
# local_useless_extremum_branches,
570+
# local_flatten_extremum,
571+
# ],
572+
# max_use_ratio=10.0,
573+
# )
574+
# fg = FunctionGraph(outputs=[out], clone=False)
575+
# rewriter.rewrite(fg)
576+
# [out] = fg.outputs
589577

590578
# Copy over previous output stacktrace
591579
# and stacktrace from previous slicing operation.

0 commit comments

Comments
 (0)