Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactoring
  • Loading branch information
xadupre committed Jul 1, 2023
commit ea899f90f72a84eba5d2a20af931fea5e7baef55
2 changes: 1 addition & 1 deletion onnx_array_api/npx/npx_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
from onnx import FunctionProto, ModelProto, NodeProto, TensorProto
from onnx.helper import make_tensor, tensor_dtype_to_np_dtype
from onnx.numpy_helper import from_array
from ..reference import from_array_extended as from_array
from .npx_constants import FUNCTION_DOMAIN
from .npx_core_api import cst, make_tuple, npxapi_inline, npxapi_no_inline, var
from .npx_types import (
Expand Down
2 changes: 1 addition & 1 deletion onnx_array_api/npx/npx_graph_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
make_opsetid,
make_tensor_value_info,
)
from onnx.numpy_helper import from_array
from onnx.onnx_cpp2py_export.checker import ValidationError
from onnx.onnx_cpp2py_export.shape_inference import InferenceError
from onnx.shape_inference import infer_shapes

from ..reference import from_array_extended as from_array
from .npx_constants import _OPSET_TO_IR_VERSION, FUNCTION_DOMAIN, ONNX_DOMAIN
from .npx_function_implementation import get_function_implementation
from .npx_helper import (
Expand Down
2 changes: 1 addition & 1 deletion onnx_array_api/npx/npx_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
make_operatorsetid,
make_value_info,
)
from onnx.numpy_helper import from_array
from onnx.version_converter import convert_version
from ..reference import from_array_extended as from_array


def rename_in_onnx_graph(
Expand Down
2 changes: 1 addition & 1 deletion onnx_array_api/plotting/_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ValueInfoProto,
)
from onnx.helper import tensor_dtype_to_np_dtype
from onnx.numpy_helper import to_array
from ..reference import to_array_extended as to_array
from ..npx.npx_types import DType


Expand Down
6 changes: 1 addition & 5 deletions onnx_array_api/plotting/dot_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
from onnx import GraphProto, ModelProto
from onnx.helper import tensor_dtype_to_string

try:
from onnx.reference.op_run import to_array_extended as to_array
except ImportError:
from onnx.numpy_helper import to_array

from ..reference import to_array_extended as to_array
from ._helper import Graph, _get_shape, attributes_as_dict


Expand Down
8 changes: 1 addition & 7 deletions onnx_array_api/plotting/text_plot.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import pprint
from collections import OrderedDict

import numpy
from onnx import AttributeProto

try:
from onnx.reference.op_run import to_array_extended as to_array
except ImportError:
from onnx.numpy_helper import to_array

from ..reference import to_array_extended as to_array
from ._helper import _get_shape, _get_type, attributes_as_dict


Expand Down
7 changes: 1 addition & 6 deletions onnx_array_api/validation/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@
make_node,
set_model_props,
)
from onnx.numpy_helper import from_array

try:
from onnx.reference.op_run import to_array_extended as to_array
except ImportError:
from onnx.numpy_helper import to_array
from ..reference import from_array_extended as from_array, to_array_extended as to_array


def randomize_proto(
Expand Down