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

Commit

Permalink
stay with original API for backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Fan committed Jul 2, 2019
1 parent 2a571a1 commit fba88ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 3 additions & 5 deletions python/mxnet/cython/ndarray.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,10 @@ def _set_np_ndarray_class(cls):
_np_ndarray_cls = cls


cdef NewArray(NDArrayHandle handle, int is_np_op, int stype=-1):
cdef NewArray(NDArrayHandle handle, int stype=-1, int is_np_array=0):
"""Create a new array given handle"""
if is_np_op:
return _np_ndarray_cls(_ctypes.cast(<unsigned long long>handle, _ctypes.c_void_p), stype=stype)
else:
return _ndarray_cls(_ctypes.cast(<unsigned long long>handle, _ctypes.c_void_p), stype=stype)
create_array_fn = _np_ndarray_cls if is_np_array else _ndarray_cls
return create_array_fn(_ctypes.cast(<unsigned long long>handle, _ctypes.c_void_p), stype=stype)


cdef class CachedOp:
Expand Down
8 changes: 3 additions & 5 deletions python/mxnet/cython/symbol.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,10 @@ def _set_np_symbol_class(cls):
_np_symbol_cls = cls


cdef NewSymbol(SymbolHandle handle, int is_np_op):
cdef NewSymbol(SymbolHandle handle, int is_np_sym=0):
"""Create a new symbol given handle"""
if is_np_op:
sym = _np_symbol_cls(None)
else:
sym = _symbol_cls(None)
create_symbol_fn = _np_symbol_cls if is_np_sym else _symbol_cls
sym = create_symbol_fn(None)
(<SymbolBase>sym).chandle = handle
return sym

Expand Down

0 comments on commit fba88ea

Please sign in to comment.