restore unrelated fixes
@@ -7,9 +7,11 @@ import numpy
from cupy import _environment
from cupy import _version
+
if sys.platform.startswith('win32') and (3, 8) <= sys.version_info: # NOQA
_environment._setup_win32_dll_directory() # NOQA
+
try:
with warnings.catch_warnings():
warnings.filterwarnings('ignore', category=ImportWarning,
@@ -37,6 +39,7 @@ original error: {}'''.format(exc_info[1])) # NOQA
raise ImportError(msg) from e
+
from cupy import cuda
# Do not make `cupy.cupyx` available because it is confusing.
import cupyx as _cupyx
@@ -48,6 +51,7 @@ def is_available():
__version__ = _version.__version__
+
from cupy import binary # NOQA
import cupy.core.fusion # NOQA
from cupy import creation # NOQA
@@ -66,10 +70,12 @@ from cupy import testing # NOQA # NOQA
from cupy import util # NOQA
from cupy import lib # NOQA
+
# import class and function
from cupy.core import ndarray # NOQA
from cupy.core import ufunc # NOQA
+
# =============================================================================
# Constants (borrowed from NumPy)
# =============================================================================
@@ -89,6 +95,7 @@ from numpy import pi # NOQA
from numpy import PINF # NOQA
from numpy import PZERO # NOQA
+
# =============================================================================
# Data types (borrowed from NumPy)
#
@@ -272,6 +279,11 @@ from cupy.creation.matrix import tri # NOQA
from cupy.creation.matrix import tril # NOQA
from cupy.creation.matrix import triu # NOQA
+# -----------------------------------------------------------------------------
+# Functional routines
+# -----------------------------------------------------------------------------
+from cupy.functional.piecewise import piecewise # NOQA
+
# -----------------------------------------------------------------------------
# Array manipulation routines
# -----------------------------------------------------------------------------
@@ -637,16 +649,13 @@ from cupy.math.misc import square # NOQA
from cupy.misc import may_share_memory # NOQA
from cupy.misc import shares_memory # NOQA
-# -----------------------------------------------------------------------------
-# Functional routines
-# -----------------------------------------------------------------------------
-from cupy.functional.piecewise import piecewise # NOQA
# -----------------------------------------------------------------------------
# Padding
# -----------------------------------------------------------------------------
pad = padding.pad.pad
+
# -----------------------------------------------------------------------------
# Sorting, searching, and counting
# -----------------------------------------------------------------------------
@@ -781,6 +790,7 @@ fuse = cupy.core.fusion.fuse
disable_experimental_feature_warning = False
+
# set default allocator
_default_memory_pool = cuda.MemoryPool()
_default_pinned_memory_pool = cuda.PinnedMemoryPool()
