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

Commit

Permalink
Revert rand_shape_nd
Browse files Browse the repository at this point in the history
  • Loading branch information
meta-project-ci committed Feb 5, 2020
1 parent 8d0f44d commit e7d2e44
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion python/mxnet/_ffi/_cython/convert.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
""" Adapted from incubator-tvm/python/tvm/_ffi/_cython/convert.pxi """

from libc.stdint cimport *
from numbers import Integral

cdef extern from "mxnet/runtime/object.h" namespace "mxnet::runtime":
cdef cppclass Object:
Expand Down Expand Up @@ -93,7 +94,7 @@ cdef inline ADT convert_list(list src) except *:


cdef inline ObjectRef convert_object(object src_obj) except *:
if isinstance(src_obj, int):
if isinstance(src_obj, Integral):
return Integer(<int>src_obj)
elif isinstance(src_obj, tuple):
return convert_tuple(src_obj)
Expand Down
2 changes: 1 addition & 1 deletion python/mxnet/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def rand_shape_3d(dim0=10, dim1=10, dim2=10, allow_zero_size=False):

def rand_shape_nd(num_dim, dim=10, allow_zero_size=False):
low = 0 if allow_zero_size else 1
return tuple([int(x) for x in rnd.randint(low, dim+1, size=num_dim)])
return tuple(rnd.randint(low, dim+1, size=num_dim))


def rand_coord_2d(x_low, x_high, y_low, y_high):
Expand Down
3 changes: 1 addition & 2 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ def config_cython():

# If `force=True` is not used and you cythonize the modules for python2 and python3
# successively, you need to delete `mxnet/cython/ndarray.cpp` after the first cythonize.
return cythonize(ret, force=True,
compiler_directives={'language_level' : sys.version_info[0]})
return cythonize(ret, force=True)
except ImportError:
print("WARNING: Cython is not installed, will compile without cython module")
return []
Expand Down

0 comments on commit e7d2e44

Please sign in to comment.