Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sparse namespace pylint #179

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion python/mxnet/ndarray/op.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import sys as _sys
import os as _os
import ctypes
import numpy as np
import numpy as np # pylint: disable=unused-import

from ..ndarray_doc import _build_doc

Expand Down
4 changes: 2 additions & 2 deletions python/mxnet/ndarray/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from ..context import Context
from . import _internal
from .ndarray import _DTYPE_NP_TO_MX, _DTYPE_MX_TO_NP
from .ndarray import _STORAGE_TYPE_STR_TO_ID, NDArrayBase
from .ndarray import _STORAGE_TYPE_STR_TO_ID
from .ndarray import NDArray, _storage_type
from .ndarray import zeros as _zeros_ndarray
from .ndarray import array as _array
Expand All @@ -61,13 +61,13 @@
if int(_os.environ.get("MXNET_ENFORCE_CYTHON", False)) != 0:
raise ImportError("Cython Module cannot be loaded but MXNET_ENFORCE_CYTHON=1")
from .._ctypes.ndarray import _set_ndarray_class
# pylint: enable=unused-import


__all__ = ["_ndarray_cls", "csr_matrix", "row_sparse_array",
"BaseSparseNDArray", "CSRNDArray", "RowSparseNDArray"]


# pylint: enable=unused-import
_STORAGE_AUX_TYPES = {
'row_sparse': [np.int64],
'csr': [np.int64, np.int64]
Expand Down
18 changes: 10 additions & 8 deletions python/mxnet/symbol/op.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,34 @@
import sys as _sys
import os as _os
import ctypes
import numpy as _numpy
import numpy as _numpy # pylint: disable=unused-import

from mxnet.base import mx_uint, check_call, _LIB, py_str, OpHandle, c_str
from mxnet.symbol_doc import _build_doc

# Use different version of SymbolBase
# When possible, use cython to speedup part of computation.
# pylint: disable=unused-import
try:
if int(_os.environ.get("MXNET_ENABLE_CYTHON", True)) == 0:
from .._ctypes.symbol import SymbolBase, _set_symbol_class
from .._ctypes.symbol import _symbol_creator # pylint: disable=unused-import
from .._ctypes.symbol import _symbol_creator
elif _sys.version_info >= (3, 0):
from .._cy3.symbol import SymbolBase, _set_symbol_class
from .._cy3.symbol import _symbol_creator # pylint: disable=unused-import
from .._cy3.symbol import _symbol_creator
else:
from .._cy2.symbol import SymbolBase, _set_symbol_class
from .._cy2.symbol import _symbol_creator # pylint: disable=unused-import
from .._cy2.symbol import _symbol_creator
except ImportError:
if int(_os.environ.get("MXNET_ENFORCE_CYTHON", False)) != 0:
raise ImportError("Cython Module cannot be loaded but MXNET_ENFORCE_CYTHON=1")
from .._ctypes.symbol import SymbolBase, _set_symbol_class
from .._ctypes.symbol import _symbol_creator # pylint: disable=unused-import
from .._ctypes.symbol import _symbol_creator

from ..base import _Null # pylint: disable=unused-import
from ..name import NameManager # pylint: disable=unused-import
from ..attribute import AttrScope # pylint: disable=unused-import
from ..base import _Null
from ..name import NameManager
from ..attribute import AttrScope
# pylint: enable=unused-import


def _make_atomic_symbol_function(handle, name):
Expand Down