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

Commit 7ca3d32

Browse files
author
Rohit Kumar Srivastava
committed
fixing local caching in ndarray shape
1 parent 24ea3c1 commit 7ca3d32

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

python/mxnet/ndarray/ndarray.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
# Caching whether MXNet was built with INT64 support or not
111111
_INT64_TENSOR_SIZE_ENABLED = None
112112

113-
def int64_enabled():
113+
def _int64_enabled():
114114
global _INT64_TENSOR_SIZE_ENABLED
115115
if _INT64_TENSOR_SIZE_ENABLED is None:
116116
_INT64_TENSOR_SIZE_ENABLED = Features().is_enabled('INT64_TENSOR_SIZE')
@@ -142,7 +142,7 @@ def _new_alloc_handle(shape, ctx, delay_alloc, dtype=mx_real_t):
142142
A new empty `NDArray` handle.
143143
"""
144144
hdl = NDArrayHandle()
145-
if sys.version_info[0] > 2 and int64_enabled():
145+
if sys.version_info[0] > 2 and _int64_enabled():
146146
check_call(_LIB.MXNDArrayCreateEx64(
147147
c_array_buf(mx_int64, native_array('q', shape)),
148148
ctypes.c_int(len(shape)),
@@ -2238,7 +2238,7 @@ def shape(self):
22382238
(2L, 3L, 4L)
22392239
"""
22402240
ndim = mx_int()
2241-
if _INT64_TENSOR_SIZE_ENABLED:
2241+
if _int64_enabled():
22422242
pdata = ctypes.POINTER(mx_int64)()
22432243
check_call(_LIB.MXNDArrayGetShapeEx64(
22442244
self.handle, ctypes.byref(ndim), ctypes.byref(pdata)))

python/mxnet/symbol/symbol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from ..base import check_call, MXNetError, NotImplementedForSymbol
4040
from ..context import Context, current_context
4141
from ..ndarray import NDArray, _DTYPE_NP_TO_MX, _DTYPE_MX_TO_NP, _GRAD_REQ_MAP
42-
from ..ndarray.ndarray import _STORAGE_TYPE_STR_TO_ID, int64_enabled
42+
from ..ndarray.ndarray import _STORAGE_TYPE_STR_TO_ID, _int64_enabled
4343
from ..ndarray import _ndarray_cls
4444
from ..executor import Executor
4545
from . import _internal

0 commit comments

Comments
 (0)