Skip to content

Commit 789f288

Browse files
Copilotgramalingam
andcommitted
Move implementation files to _internal and create public API shims
Co-authored-by: gramalingam <10075881+gramalingam@users.noreply.github.com>
1 parent 7df9282 commit 789f288

17 files changed

+2091
-1989
lines changed

onnxscript/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
import importlib.metadata
6868

6969
from .backend.onnx_export import export2python as proto2python
70-
from .main import export_onnx_lib, graph, script
70+
from ._internal.main import export_onnx_lib, graph, script
7171

7272
# isort: off
7373
from .onnx_opset import (
@@ -128,7 +128,7 @@
128128

129129
from . import ir, optimizer, rewriter, version_converter
130130
from ._internal.utils import external_tensor
131-
from .values import OnnxFunction, TracedOnnxFunction
131+
from ._internal.values import OnnxFunction, TracedOnnxFunction
132132

133133
# Set DEBUG to True to enable additional debug checks
134134
DEBUG: bool = False

onnxscript/_internal/autocast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from onnxscript import ir, tensor
1414

1515
if TYPE_CHECKING:
16-
from onnxscript import converter
16+
from onnxscript._internal import converter
1717

1818
# Conversions from python values to ONNX are used by both the script converter as well
1919
# as the eager-mode runtime and both need to be consistent. The script converter converts
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,16 @@
2020
import onnx_ir as ir
2121

2222
import onnxscript
23-
from onnxscript import irbuilder, onnx_types, sourceinfo, values
24-
from onnxscript import type_annotation as ta
25-
from onnxscript._internal import analysis, ast_utils, autocast, param_manipulation
23+
from onnxscript import onnx_types, sourceinfo
24+
from onnxscript._internal import (
25+
analysis,
26+
ast_utils,
27+
autocast,
28+
irbuilder,
29+
param_manipulation,
30+
type_annotation as ta,
31+
values,
32+
)
2633

2734
logger = logging.getLogger("onnxscript")
2835

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323

2424
import onnxscript
2525
import onnxscript.testing
26-
from onnxscript import BOOL, FLOAT, INT64, converter, graph, script, tensor
26+
from onnxscript import BOOL, FLOAT, INT64, graph, script, tensor
27+
from onnxscript._internal import converter
2728
from onnxscript.onnx_opset import opset11 as op11
2829
from onnxscript.onnx_opset import opset15 as op
2930
from tests.common import onnx_script_test_case, testutils

0 commit comments

Comments
 (0)