Skip to content

Commit 7c6dd73

Browse files
committed
renaming
1 parent 11139ec commit 7c6dd73

File tree

7 files changed

+17
-14
lines changed

7 files changed

+17
-14
lines changed

_doc/api/export/control_flow.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
onnx_diagnostic.export.control_flow_onnx
3+
========================================
4+
5+
.. automodule:: onnx_diagnostic.export.control_flow_onnx
6+
:members:

_doc/api/export/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ onnx_diagnostic.export
66
:caption: modules
77

88
api
9-
control_flow
9+
control_flow_onnx
1010
dynamic_shapes
1111
onnx_plug
1212
shape_helper

_unittests/ut_export/test_control_flow.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
from onnxscript import script, FLOAT, INT64
55
from onnxscript import opset18 as op
66
from onnx_diagnostic.ext_test_case import ExtTestCase, requires_torch, never_test
7-
from onnx_diagnostic.export.control_flow import enable_code_export_control_flow, loop_for_onnx
7+
from onnx_diagnostic.export.control_flow_onnx import (
8+
enable_code_export_control_flow,
9+
loop_for_onnx,
10+
)
811
from onnx_diagnostic.export.control_flow_research import simple_loop_for as loop_for_r
912
from onnx_diagnostic.export.api import to_onnx
1013

onnx_diagnostic/export/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def to_onnx(
4343
:param save_ep: saves the exported program
4444
:param optimize: optimizes the model
4545
:param use_control_flow_dispatcher: use the dispatcher created to supported
46-
custom loops (see :func:`onnx_diagnostic.export.control_flow.loop_for_onnx`)
46+
custom loops (see :func:`onnx_diagnostic.export.control_flow_onnx.loop_for_onnx`)
4747
:param onnx_plugs: the code was modified to replace some parts with onnx translation
4848
:param inline: inline local functions
4949
:return: the output of the selected exporter, usually a structure including
@@ -62,7 +62,7 @@ def to_onnx(
6262
)
6363
6464
Some examples using control flows are available in
65-
:func:`onnx_diagnostic.export.control_flow.loop_for_onnx` or
65+
:func:`onnx_diagnostic.export.control_flow_onnx.loop_for_onnx` or
6666
:class:`onnx_diagnostic.export.onnx_plug.EagerDirectReplacementWithOnnx`.
6767
"""
6868
if exporter_kwargs and "inline" in exporter_kwargs:
@@ -86,7 +86,7 @@ def to_onnx(
8686
from experimental_experiment.torch_interpreter import Dispatcher
8787

8888
if use_control_flow_dispatcher:
89-
from .control_flow import create_global_dispatcher
89+
from .control_flow_onnx import create_global_dispatcher
9090

9191
control_flow_dispatcher = create_global_dispatcher()
9292
else:

onnx_diagnostic/export/control_flow_research.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
)
1515
from torch.fx.experimental.proxy_tensor import ProxyTorchDispatchMode, track_tensor_tree
1616
from torch.utils._python_dispatch import _get_current_dispatch_mode
17-
from .control_flow import _loop_for_fn
17+
from .control_flow_onnx import _loop_for_onnx_fn
1818

1919

2020
class SimpleLoopForOp(HigherOrderOperator):
@@ -66,7 +66,7 @@ def simple_loop_for(
6666
return simple_loop_for_op(n_iter, body_fn, (n_iter, *operands))
6767

6868
if isinstance(n_iter, (bool, int, float)):
69-
return _loop_for_fn(body_fn, n_iter, None, *operands)
69+
return _loop_for_onnx_fn(body_fn, n_iter, None, *operands)
7070

7171
def _validate_input(n_iter, body_fn, operands):
7272
assert isinstance(
@@ -127,7 +127,7 @@ def loop_for_op_dense(n_iter, body_fn, operands):
127127
), f"Dense implementation operands must be a list of tensors and ints {operands}"
128128
mode = _get_current_dispatch_mode()
129129
assert mode is None, "Mode should never be enabled for CPU/CUDA key"
130-
return _loop_for_fn(body_fn, n_iter, None, *operands)
130+
return _loop_for_onnx_fn(body_fn, n_iter, None, *operands)
131131

132132

133133
@simple_loop_for_op.py_impl(ProxyTorchDispatchMode)

0 commit comments

Comments
 (0)