diff --git a/mindspore/lite/python/api/__init__.py b/mindspore/lite/python/api/__init__.py index de3a3fabd80..cac21c0d605 100644 --- a/mindspore/lite/python/api/__init__.py +++ b/mindspore/lite/python/api/__init__.py @@ -15,13 +15,16 @@ """ MindSpore Lite Python API. """ +from __future__ import absolute_import -from .context import Context, DeviceInfo, CPUDeviceInfo, GPUDeviceInfo, AscendDeviceInfo -from .converter import FmkType, Converter -from .model import ModelType, Model, RunnerConfig, ModelParallelRunner -from .tensor import DataType, Format, Tensor +from mindspore_lite.version import __version__ +from mindspore_lite.context import Context, DeviceInfo, CPUDeviceInfo, GPUDeviceInfo, AscendDeviceInfo +from mindspore_lite.converter import FmkType, Converter +from mindspore_lite.model import ModelType, Model, RunnerConfig, ModelParallelRunner +from mindspore_lite.tensor import DataType, Format, Tensor __all__ = [] +__all__.extend(__version__) __all__.extend(context.__all__) __all__.extend(converter.__all__) __all__.extend(model.__all__) diff --git a/mindspore/lite/python/api/context.py b/mindspore/lite/python/api/context.py index 7838ff6622b..b24931bf3e0 100644 --- a/mindspore/lite/python/api/context.py +++ b/mindspore/lite/python/api/context.py @@ -15,8 +15,9 @@ """ Context API. """ -from ._checkparam import check_isinstance, check_list_of_element -from .lib import _c_lite_wrapper +from __future__ import absolute_import +from mindspore_lite._checkparam import check_isinstance, check_list_of_element +from mindspore_lite.lib import _c_lite_wrapper __all__ = ['Context', 'DeviceInfo', 'CPUDeviceInfo', 'GPUDeviceInfo', 'AscendDeviceInfo'] diff --git a/mindspore/lite/python/api/converter.py b/mindspore/lite/python/api/converter.py index 5ef2570e198..05992154483 100644 --- a/mindspore/lite/python/api/converter.py +++ b/mindspore/lite/python/api/converter.py @@ -15,14 +15,15 @@ """ Converter API. """ - +from __future__ import absolute_import import os from enum import Enum -from ._checkparam import check_isinstance, check_input_shape, check_config_info -from .lib import _c_lite_wrapper -from .tensor import DataType, Format, data_type_py_cxx_map, data_type_cxx_py_map, format_py_cxx_map, format_cxx_py_map -from .model import ModelType, model_type_py_cxx_map, model_type_cxx_py_map +from mindspore_lite._checkparam import check_isinstance, check_input_shape, check_config_info +from mindspore_lite.lib import _c_lite_wrapper +from mindspore_lite.tensor import DataType, Format, data_type_py_cxx_map, data_type_cxx_py_map, format_py_cxx_map, \ + format_cxx_py_map +from mindspore_lite.model import ModelType, model_type_py_cxx_map, model_type_cxx_py_map __all__ = ['FmkType', 'Converter'] diff --git a/mindspore/lite/python/api/model.py b/mindspore/lite/python/api/model.py index 3e03dcffbc7..b207373b776 100644 --- a/mindspore/lite/python/api/model.py +++ b/mindspore/lite/python/api/model.py @@ -15,13 +15,14 @@ """ Model API. """ +from __future__ import absolute_import import os from enum import Enum -from ._checkparam import check_isinstance -from .context import Context -from .lib import _c_lite_wrapper -from .tensor import Tensor +from mindspore_lite._checkparam import check_isinstance +from mindspore_lite.context import Context +from mindspore_lite.lib import _c_lite_wrapper +from mindspore_lite.tensor import Tensor __all__ = ['ModelType', 'Model', 'RunnerConfig', 'ModelParallelRunner'] diff --git a/mindspore/lite/python/api/tensor.py b/mindspore/lite/python/api/tensor.py index e62ff8b4602..34f0ce39f94 100644 --- a/mindspore/lite/python/api/tensor.py +++ b/mindspore/lite/python/api/tensor.py @@ -15,11 +15,12 @@ """ Tensor API. """ +from __future__ import absolute_import from enum import Enum import numpy -from .lib import _c_lite_wrapper +from mindspore_lite.lib import _c_lite_wrapper __all__ = ['DataType', 'Format', 'Tensor']