Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Renamed onnx support folders to mark it public folders
Browse files Browse the repository at this point in the history
Changed underline files public or private as per usage

Resolved conflicts with the latest
  • Loading branch information
rajanksin committed Jun 14, 2018
1 parent c668689 commit 43788cf
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 37 deletions.
6 changes: 3 additions & 3 deletions python/mxnet/contrib/onnx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
# under the License.
"""Module for ONNX model format support for Apache MXNet."""

from ._import.import_model import import_model, get_model_metadata
from ._import.import_to_gluon import import_to_gluon
from ._export.export_model import export_model
from .onnx2mx.import_model import import_model, get_model_metadata
from .onnx2mx.import_to_gluon import import_to_gluon
from .mx2onnx.export_model import export_model
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@

from . import export_model
from . import export_onnx
from . import op_translations
from . import _op_translations
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from ....base import string_types
from .... import symbol
from .export_onnx import MXNetGraph
from .export_helper import load_module
from ._export_helper import load_module


def export_model(sym, params, input_shape, input_type=np.float32,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@
# specific language governing permissions and limitations
# under the License.

# coding: utf-8
# coding: utf-8_
# pylint: disable=invalid-name
"""Operator attributes conversion"""
from .op_translations import identity, random_uniform, random_normal
from .op_translations import add, subtract, multiply, divide, absolute, negative, add_n
from .op_translations import tanh
from .op_translations import ceil, floor
from .op_translations import concat
from .op_translations import leaky_relu, _elu, _prelu, softmax, fully_connected
from .op_translations import global_avgpooling, global_maxpooling, linalg_gemm
from .op_translations import sigmoid, pad, relu, matrix_multiplication, batch_norm
from .op_translations import dropout, local_response_norm, conv, deconv
from .op_translations import reshape, cast, split, _slice, transpose, squeeze, flatten
from .op_translations import reciprocal, squareroot, power, exponent, _log, unsqueeze
from .op_translations import reduce_max, reduce_mean, reduce_min, reduce_sum
from .op_translations import reduce_prod, avg_pooling, max_pooling
from .op_translations import argmax, argmin, maximum, minimum
from .op_translations import clip, reduce_log_sum, reduce_log_sum_exp
from .op_translations import reduce_sum_square, reduce_l2, max_roi_pooling, instance_norm
from .op_translations import log_softmax, softsign, lesser, greater, equal
from .op_translations import logical_and, logical_or, logical_xor, logical_not
from ._op_translations import identity, random_uniform, random_normal
from ._op_translations import add, subtract, multiply, divide, absolute, negative, add_n
from ._op_translations import tanh
from ._op_translations import ceil, floor
from ._op_translations import concat
from ._op_translations import leaky_relu, _elu, _prelu, softmax, fully_connected
from ._op_translations import global_avgpooling, global_maxpooling, linalg_gemm
from ._op_translations import sigmoid, pad, relu, matrix_multiplication, batch_norm
from ._op_translations import dropout, local_response_norm, conv, deconv
from ._op_translations import reshape, cast, split, _slice, transpose, squeeze, flatten
from ._op_translations import reciprocal, squareroot, power, exponent, _log, unsqueeze
from ._op_translations import reduce_max, reduce_mean, reduce_min, reduce_sum
from ._op_translations import reduce_prod, avg_pooling, max_pooling
from ._op_translations import argmax, argmin, maximum, minimum
from ._op_translations import clip, reduce_log_sum, reduce_log_sum_exp
from ._op_translations import reduce_sum_square, reduce_l2, max_roi_pooling, instance_norm
from ._op_translations import log_softmax, softsign, lesser, greater, equal
from ._op_translations import logical_and, logical_or, logical_xor, logical_not

# convert_map defines maps of ONNX operator names to converter functor(callable)
# defined in the op_translations module.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
""" Module for translating ONNX operators into Mxnet operatoes"""
# pylint: disable=unused-argument,protected-access
import numpy as np
from . import translation_utils
from . import _translation_utils as translation_utils
from .... import symbol

# Method definitions for the callable objects mapped in the import_helper module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from .... import cpu, gpu
from .... import ndarray as nd
from ....base import string_types
from .import_helper import _convert_map as convert_map
from ._import_helper import _convert_map as convert_map

class GraphProto(object): # pylint: disable=too-few-public-methods
"""A helper class for handling mxnet symbol copying from pb2.GraphProto.
Expand Down
5 changes: 2 additions & 3 deletions tests/python-pytest/onnx/export/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@

# coding: utf-8
"""backend wrapper for onnx test infrastructure"""
import mxnet as mx
import numpy as np
from mxnet.contrib.onnx._import.import_onnx import GraphProto
from mxnet.contrib.onnx._export.export_onnx import MXNetGraph
from mxnet.contrib.onnx.onnx2mx.import_onnx import GraphProto
from mxnet.contrib.onnx.mx2onnx.export_onnx import MXNetGraph
try:
from onnx import helper, TensorProto, mapping
from onnx.backend.base import Backend
Expand Down
1 change: 0 additions & 1 deletion tests/python-pytest/onnx/export/backend_rep.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

# coding: utf-8
"""backend rep for onnx test infrastructure"""
import numpy as np
try:
from onnx.backend.base import BackendRep
except ImportError:
Expand Down
6 changes: 2 additions & 4 deletions tests/python-pytest/onnx/import/gluon_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@

# coding: utf-8
"""Gluon backend wrapper for onnx test infrastructure"""
import mxnet as mx
from mxnet import nd
from mxnet.contrib.onnx._import.import_onnx import GraphProto
import numpy as np
from mxnet.contrib.onnx.onnx2mx.import_onnx import GraphProto

try:
from onnx import helper, TensorProto
from onnx.backend.base import Backend
Expand Down
3 changes: 1 addition & 2 deletions tests/python-pytest/onnx/import/mxnet_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

# coding: utf-8
"""MXNet backend wrapper for onnx test infrastructure"""
import mxnet as mx
from mxnet.contrib.onnx._import.import_onnx import GraphProto
from mxnet.contrib.onnx.onnx2mx.import_onnx import GraphProto
try:
from onnx import helper, TensorProto
from onnx.backend.base import Backend
Expand Down
1 change: 0 additions & 1 deletion tests/python-pytest/onnx/import/mxnet_backend_rep.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

# coding: utf-8
"""MXNet backend rep for onnx test infrastructure"""
import numpy as np
try:
from onnx.backend.base import BackendRep
except ImportError:
Expand Down

0 comments on commit 43788cf

Please sign in to comment.