Skip to content

Commit 841d391

Browse files
committed
use deduplicate instead of Deduplicator
1 parent e148f36 commit 841d391

4 files changed

Lines changed: 8 additions & 10 deletions

File tree

arraycontext/impl/pytato/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,8 @@ def _to_frozen(key: tuple[Any, ...], ary) -> TaggableCLArray:
599599
dag = pt.make_dict_of_named_arrays(
600600
key_to_pt_arrays)
601601

602-
from pytato.transform import Deduplicator
603-
dag = Deduplicator()(dag)
602+
from pytato.transform import deduplicate
603+
dag = deduplicate(dag)
604604

605605
# FIXME: Remove this if/when _normalize_pt_expr gets support for functions
606606
dag = pt.tag_all_calls_to_be_inlined(dag)

arraycontext/impl/pytato/compile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from __future__ import annotations
99

1010
from pytato.array import AxesT
11-
from pytato.transform import Deduplicator
1211

1312

1413
__copyright__ = """
@@ -196,7 +195,8 @@ def _to_input_for_compiled(
196195
"""
197196
from arraycontext.impl.pyopencl.taggable_cl_array import to_tagged_cl_array
198197
if isinstance(ary, pt.Array):
199-
dag = Deduplicator()(pt.make_dict_of_named_arrays({"_actx_out": ary}))
198+
dag = pt.transform.deduplicate(
199+
pt.make_dict_of_named_arrays({"_actx_out": ary}))
200200
# Transform the DAG to give metadata inference a chance to do its job
201201
return actx.transform_dag(dag)["_actx_out"].expr
202202
elif isinstance(ary, TaggableCLArray):

arraycontext/impl/pytato/outline.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from __future__ import annotations
22

3-
from pytato.transform import Deduplicator
4-
53

64
__doc__ = """
75
.. autoclass:: OutlinedCall
@@ -214,7 +212,7 @@ def __call__(self, *args: object, **kwargs: object) -> ArrayOrContainer:
214212

215213
prefixed_output = _call_with_placeholders(
216214
self.f, args, kwargs, arg_id_to_prefixed_placeholder)
217-
unpacked_prefixed_output = Deduplicator()(
215+
unpacked_prefixed_output = pt.transform.deduplicate(
218216
pt.make_dict_of_named_arrays(_unpack_output(prefixed_output)))
219217

220218
prefixed_placeholders = frozenset(
@@ -232,7 +230,7 @@ def __call__(self, *args: object, **kwargs: object) -> ArrayOrContainer:
232230
arg_id_to_placeholder = _get_arg_id_to_placeholder(arg_id_to_arg)
233231

234232
output = _call_with_placeholders(self.f, args, kwargs, arg_id_to_placeholder)
235-
unpacked_output = Deduplicator()(
233+
unpacked_output = pt.transform.deduplicate(
236234
pt.make_dict_of_named_arrays(_unpack_output(output)))
237235
if len(unpacked_output) == 1 and "_" in unpacked_output:
238236
ret_type = pt.function.ReturnType.ARRAY

arraycontext/impl/pytato/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
ArrayOrNames,
6060
ArrayOrNamesTc,
6161
CopyMapper,
62-
Deduplicator,
6362
TransformMapperCache,
63+
deduplicate,
6464
)
6565
from pytools import UniqueNameGenerator, memoize_method
6666

@@ -151,7 +151,7 @@ def _normalize_pt_expr(
151151
Deterministic naming of placeholders permits more effective caching of
152152
equivalent graphs.
153153
"""
154-
expr = Deduplicator()(expr)
154+
expr = deduplicate(expr)
155155

156156
if get_num_call_sites(expr):
157157
raise NotImplementedError(

0 commit comments

Comments
 (0)