eric-haibin-lin commented on issue #18600:
URL: 
https://github.com/apache/incubator-mxnet/issues/18600#issuecomment-647214447


   np.delete also fails the compatibility test:
   ```
   [2020-06-22T00:36:45.758Z] ================================== FAILURES 
===================================
   [2020-06-22T00:36:45.758Z] _______________________ 
test_np_array_function_protocol _______________________
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z] args = (), kwargs = {}
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z]     @functools.wraps(func)
   [2020-06-22T00:36:45.758Z]     def _run_with_array_func_proto(*args, 
**kwargs):
   [2020-06-22T00:36:45.758Z]         if cur_np_ver >= np_1_17_ver:
   [2020-06-22T00:36:45.758Z]             try:
   [2020-06-22T00:36:45.758Z] >               func(*args, **kwargs)
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z] 
windows_package\python\mxnet\numpy_dispatch_protocol.py:55: 
   [2020-06-22T00:36:45.758Z] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z]     @with_seed()
   [2020-06-22T00:36:45.758Z]     @use_np
   [2020-06-22T00:36:45.758Z]     @with_array_function_protocol
   [2020-06-22T00:36:45.758Z]     @pytest.mark.serial
   [2020-06-22T00:36:45.758Z]     def test_np_array_function_protocol():
   [2020-06-22T00:36:45.758Z] >       
check_interoperability(_NUMPY_ARRAY_FUNCTION_LIST)
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z] 
tests\python\unittest\test_numpy_interoperability.py:3262: 
   [2020-06-22T00:36:45.758Z] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z] op_list = ['all', 'any', 'sometrue', 'argmin', 
'argmax', 'around', ...]
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z]     def check_interoperability(op_list):
   [2020-06-22T00:36:45.758Z]         for name in op_list:
   [2020-06-22T00:36:45.758Z]             if name in _TVM_OPS and not 
is_op_runnable():
   [2020-06-22T00:36:45.758Z]                 continue
   [2020-06-22T00:36:45.758Z]             if name in ['shares_memory', 
'may_share_memory', 'empty_like',
   [2020-06-22T00:36:45.758Z]                         '__version__', 'dtype', 
'_NoValue']:  # skip list
   [2020-06-22T00:36:45.758Z]                 continue
   [2020-06-22T00:36:45.758Z]             if name in ['full_like', 
'zeros_like', 'ones_like'] and \
   [2020-06-22T00:36:45.758Z]                     
StrictVersion(platform.python_version()) < StrictVersion('3.0.0'):
   [2020-06-22T00:36:45.758Z]                 continue
   [2020-06-22T00:36:45.758Z]             print('Dispatch test:', name)
   [2020-06-22T00:36:45.758Z]             workloads = 
OpArgMngr.get_workloads(name)
   [2020-06-22T00:36:45.758Z]             assert workloads is not None, 
'Workloads for operator `{}` has not been ' \
   [2020-06-22T00:36:45.758Z]                                           'added 
for checking interoperability with ' \
   [2020-06-22T00:36:45.758Z]                                           'the 
official NumPy.'.format(name)
   [2020-06-22T00:36:45.758Z]             for workload in workloads:
   [2020-06-22T00:36:45.758Z] >               
_check_interoperability_helper(name, *workload['args'], **workload['kwargs'])
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z] 
tests\python\unittest\test_numpy_interoperability.py:3240: 
   [2020-06-22T00:36:45.758Z] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z] op_name = 'delete', args = (array([0., 1., 2., 
3., 4.]), array([]))
   [2020-06-22T00:36:45.758Z] kwargs = {'axis': 0}, strs = ['delete']
   [2020-06-22T00:36:45.758Z] onp_op = <function delete at 0x000002C47E8C7158>
   [2020-06-22T00:36:45.758Z] out = array([0., 1., 2., 3., 4.])
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z]     def _check_interoperability_helper(op_name, 
*args, **kwargs):
   [2020-06-22T00:36:45.758Z]         strs = op_name.split('.')
   [2020-06-22T00:36:45.758Z]         if len(strs) == 1:
   [2020-06-22T00:36:45.758Z]             onp_op = getattr(_np, op_name)
   [2020-06-22T00:36:45.758Z]         elif len(strs) == 2:
   [2020-06-22T00:36:45.758Z]             onp_op = getattr(getattr(_np, 
strs[0]), strs[1])
   [2020-06-22T00:36:45.758Z]         else:
   [2020-06-22T00:36:45.758Z]             assert False
   [2020-06-22T00:36:45.758Z]         if not is_op_runnable():
   [2020-06-22T00:36:45.758Z]             return
   [2020-06-22T00:36:45.758Z]         out = onp_op(*args, **kwargs)
   [2020-06-22T00:36:45.758Z] >       expected_out = 
_get_numpy_op_output(onp_op, *args, **kwargs)
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z] 
tests\python\unittest\test_numpy_interoperability.py:3204: 
   [2020-06-22T00:36:45.758Z] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z] onp_op = <function delete at 0x000002C47E8C7158>
   [2020-06-22T00:36:45.758Z] args = (array([0., 1., 2., 3., 4.]), array([])), 
kwargs = {'axis': 0}
   [2020-06-22T00:36:45.758Z] onp_args = [array([0., 1., 2., 3., 4.], 
dtype=float32), array([], dtype=float32)]
   [2020-06-22T00:36:45.758Z] onp_kwargs = {'axis': 0}, i = 1, v = array([], 
dtype=float32)
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z]     def _get_numpy_op_output(onp_op, *args, 
**kwargs):
   [2020-06-22T00:36:45.758Z]         onp_args = [arg.asnumpy() if 
isinstance(arg, np.ndarray) else arg for arg in args]
   [2020-06-22T00:36:45.758Z]         onp_kwargs = {k: v.asnumpy() if 
isinstance(v, np.ndarray) else v for k, v in kwargs.items()}
   [2020-06-22T00:36:45.758Z]         for i, v in enumerate(onp_args):
   [2020-06-22T00:36:45.758Z]             if isinstance(v, (list, tuple)):
   [2020-06-22T00:36:45.758Z]                 new_arrs = [a.asnumpy() if 
isinstance(a, np.ndarray) else a for a in v]
   [2020-06-22T00:36:45.758Z]                 onp_args[i] = new_arrs
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z] >       return onp_op(*onp_args, **onp_kwargs)
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z] 
tests\python\unittest\test_numpy_interoperability.py:3190: 
   [2020-06-22T00:36:45.758Z] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z] args = (array([0., 1., 2., 3., 4.], 
dtype=float32), array([], dtype=float32))
   [2020-06-22T00:36:45.758Z] kwargs = {'axis': 0}
   [2020-06-22T00:36:45.758Z] relevant_args = (array([0., 1., 2., 3., 4.], 
dtype=float32), array([], dtype=float32))
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z] >   ???
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z] <__array_function__ internals>:6: 
   [2020-06-22T00:36:45.758Z] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z] arr = array([0., 1., 2., 3., 4.], dtype=float32), 
obj = array([], dtype=float32)
   [2020-06-22T00:36:45.758Z] axis = 0
   [2020-06-22T00:36:45.758Z] 
   [2020-06-22T00:36:45.758Z]     @array_function_dispatch(_delete_dispatcher)
   [2020-06-22T00:36:45.758Z]     def delete(arr, obj, axis=None):
   [2020-06-22T00:36:45.758Z]         """
   [2020-06-22T00:36:45.758Z]         Return a new array with sub-arrays along 
an axis deleted. For a one
   [2020-06-22T00:36:45.758Z]         dimensional array, this returns those 
entries not returned by
   [2020-06-22T00:36:45.758Z]         `arr[obj]`.
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]         Parameters
   [2020-06-22T00:36:45.758Z]         ----------
   [2020-06-22T00:36:45.758Z]         arr : array_like
   [2020-06-22T00:36:45.758Z]             Input array.
   [2020-06-22T00:36:45.758Z]         obj : slice, int or array of ints
   [2020-06-22T00:36:45.758Z]             Indicate indices of sub-arrays to 
remove along the specified axis.
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]             .. versionchanged:: 1.19.0
   [2020-06-22T00:36:45.758Z]                 Boolean indices are now treated 
as a mask of elements to remove,
   [2020-06-22T00:36:45.758Z]                 rather than being cast to the 
integers 0 and 1.
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]         axis : int, optional
   [2020-06-22T00:36:45.758Z]             The axis along which to delete the 
subarray defined by `obj`.
   [2020-06-22T00:36:45.758Z]             If `axis` is None, `obj` is applied 
to the flattened array.
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]         Returns
   [2020-06-22T00:36:45.758Z]         -------
   [2020-06-22T00:36:45.758Z]         out : ndarray
   [2020-06-22T00:36:45.758Z]             A copy of `arr` with the elements 
specified by `obj` removed. Note
   [2020-06-22T00:36:45.758Z]             that `delete` does not occur 
in-place. If `axis` is None, `out` is
   [2020-06-22T00:36:45.758Z]             a flattened array.
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]         See Also
   [2020-06-22T00:36:45.758Z]         --------
   [2020-06-22T00:36:45.758Z]         insert : Insert elements into an array.
   [2020-06-22T00:36:45.758Z]         append : Append elements at the end of an 
array.
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]         Notes
   [2020-06-22T00:36:45.758Z]         -----
   [2020-06-22T00:36:45.758Z]         Often it is preferable to use a boolean 
mask. For example:
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]         >>> arr = np.arange(12) + 1
   [2020-06-22T00:36:45.758Z]         >>> mask = np.ones(len(arr), dtype=bool)
   [2020-06-22T00:36:45.758Z]         >>> mask[[0,2,4]] = False
   [2020-06-22T00:36:45.758Z]         >>> result = arr[mask,...]
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]         Is equivalent to `np.delete(arr, [0,2,4], 
axis=0)`, but allows further
   [2020-06-22T00:36:45.758Z]         use of `mask`.
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]         Examples
   [2020-06-22T00:36:45.758Z]         --------
   [2020-06-22T00:36:45.758Z]         >>> arr = np.array([[1,2,3,4], [5,6,7,8], 
[9,10,11,12]])
   [2020-06-22T00:36:45.758Z]         >>> arr
   [2020-06-22T00:36:45.758Z]         array([[ 1,  2,  3,  4],
   [2020-06-22T00:36:45.758Z]                [ 5,  6,  7,  8],
   [2020-06-22T00:36:45.758Z]                [ 9, 10, 11, 12]])
   [2020-06-22T00:36:45.758Z]         >>> np.delete(arr, 1, 0)
   [2020-06-22T00:36:45.758Z]         array([[ 1,  2,  3,  4],
   [2020-06-22T00:36:45.758Z]                [ 9, 10, 11, 12]])
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]         >>> np.delete(arr, np.s_[::2], 1)
   [2020-06-22T00:36:45.758Z]         array([[ 2,  4],
   [2020-06-22T00:36:45.758Z]                [ 6,  8],
   [2020-06-22T00:36:45.758Z]                [10, 12]])
   [2020-06-22T00:36:45.758Z]         >>> np.delete(arr, [1,3,5], None)
   [2020-06-22T00:36:45.758Z]         array([ 1,  3,  5,  7,  8,  9, 10, 11, 
12])
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]         """
   [2020-06-22T00:36:45.758Z]         wrap = None
   [2020-06-22T00:36:45.758Z]         if type(arr) is not ndarray:
   [2020-06-22T00:36:45.758Z]             try:
   [2020-06-22T00:36:45.758Z]                 wrap = arr.__array_wrap__
   [2020-06-22T00:36:45.758Z]             except AttributeError:
   [2020-06-22T00:36:45.758Z]                 pass
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]         arr = asarray(arr)
   [2020-06-22T00:36:45.758Z]         ndim = arr.ndim
   [2020-06-22T00:36:45.758Z]         arrorder = 'F' if arr.flags.fnc else 'C'
   [2020-06-22T00:36:45.758Z]         if axis is None:
   [2020-06-22T00:36:45.758Z]             if ndim != 1:
   [2020-06-22T00:36:45.758Z]                 arr = arr.ravel()
   [2020-06-22T00:36:45.758Z]             # needed for np.matrix, which is 
still not 1d after being ravelled
   [2020-06-22T00:36:45.758Z]             ndim = arr.ndim
   [2020-06-22T00:36:45.758Z]             axis = ndim - 1
   [2020-06-22T00:36:45.758Z]         else:
   [2020-06-22T00:36:45.758Z]             axis = normalize_axis_index(axis, 
ndim)
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]         slobj = [slice(None)]*ndim
   [2020-06-22T00:36:45.758Z]         N = arr.shape[axis]
   [2020-06-22T00:36:45.758Z]         newshape = list(arr.shape)
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]         if isinstance(obj, slice):
   [2020-06-22T00:36:45.758Z]             start, stop, step = obj.indices(N)
   [2020-06-22T00:36:45.758Z]             xr = range(start, stop, step)
   [2020-06-22T00:36:45.758Z]             numtodel = len(xr)
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]             if numtodel <= 0:
   [2020-06-22T00:36:45.758Z]                 if wrap:
   [2020-06-22T00:36:45.758Z]                     return 
wrap(arr.copy(order=arrorder))
   [2020-06-22T00:36:45.758Z]                 else:
   [2020-06-22T00:36:45.758Z]                     return 
arr.copy(order=arrorder)
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]             # Invert if step is negative:
   [2020-06-22T00:36:45.758Z]             if step < 0:
   [2020-06-22T00:36:45.758Z]                 step = -step
   [2020-06-22T00:36:45.758Z]                 start = xr[-1]
   [2020-06-22T00:36:45.758Z]                 stop = xr[0] + 1
   [2020-06-22T00:36:45.758Z]     
   [2020-06-22T00:36:45.758Z]             newshape[axis] -= numtodel
   [2020-06-22T00:36:45.758Z]             new = empty(newshape, arr.dtype, 
arrorder)
   [2020-06-22T00:36:45.758Z]             # copy initial chunk
   [2020-06-22T00:36:45.758Z]             if start == 0:
   [2020-06-22T00:36:45.758Z]                 pass
   [2020-06-22T00:36:45.758Z]             else:
   [2020-06-22T00:36:45.758Z]                 slobj[axis] = slice(None, start)
   [2020-06-22T00:36:45.758Z]                 new[tuple(slobj)] = 
arr[tuple(slobj)]
   [2020-06-22T00:36:45.758Z]             # copy end chunk
   [2020-06-22T00:36:45.758Z]             if stop == N:
   [2020-06-22T00:36:45.758Z]                 pass
   [2020-06-22T00:36:45.759Z]             else:
   [2020-06-22T00:36:45.759Z]                 slobj[axis] = 
slice(stop-numtodel, None)
   [2020-06-22T00:36:45.759Z]                 slobj2 = [slice(None)]*ndim
   [2020-06-22T00:36:45.759Z]                 slobj2[axis] = slice(stop, None)
   [2020-06-22T00:36:45.759Z]                 new[tuple(slobj)] = 
arr[tuple(slobj2)]
   [2020-06-22T00:36:45.759Z]             # copy middle pieces
   [2020-06-22T00:36:45.759Z]             if step == 1:
   [2020-06-22T00:36:45.759Z]                 pass
   [2020-06-22T00:36:45.759Z]             else:  # use array indexing.
   [2020-06-22T00:36:45.759Z]                 keep = ones(stop-start, 
dtype=bool)
   [2020-06-22T00:36:45.759Z]                 keep[:stop-start:step] = False
   [2020-06-22T00:36:45.759Z]                 slobj[axis] = slice(start, 
stop-numtodel)
   [2020-06-22T00:36:45.759Z]                 slobj2 = [slice(None)]*ndim
   [2020-06-22T00:36:45.759Z]                 slobj2[axis] = slice(start, stop)
   [2020-06-22T00:36:45.759Z]                 arr = arr[tuple(slobj2)]
   [2020-06-22T00:36:45.759Z]                 slobj2[axis] = keep
   [2020-06-22T00:36:45.759Z]                 new[tuple(slobj)] = 
arr[tuple(slobj2)]
   [2020-06-22T00:36:45.759Z]             if wrap:
   [2020-06-22T00:36:45.759Z]                 return wrap(new)
   [2020-06-22T00:36:45.759Z]             else:
   [2020-06-22T00:36:45.759Z]                 return new
   [2020-06-22T00:36:45.759Z]     
   [2020-06-22T00:36:45.759Z]         if isinstance(obj, (int, integer)) and 
not isinstance(obj, bool):
   [2020-06-22T00:36:45.759Z]             # optimization for a single value
   [2020-06-22T00:36:45.759Z]             if (obj < -N or obj >= N):
   [2020-06-22T00:36:45.759Z]                 raise IndexError(
   [2020-06-22T00:36:45.759Z]                     "index %i is out of bounds 
for axis %i with "
   [2020-06-22T00:36:45.759Z]                     "size %i" % (obj, axis, N))
   [2020-06-22T00:36:45.759Z]             if (obj < 0):
   [2020-06-22T00:36:45.759Z]                 obj += N
   [2020-06-22T00:36:45.759Z]             newshape[axis] -= 1
   [2020-06-22T00:36:45.759Z]             new = empty(newshape, arr.dtype, 
arrorder)
   [2020-06-22T00:36:45.759Z]             slobj[axis] = slice(None, obj)
   [2020-06-22T00:36:45.759Z]             new[tuple(slobj)] = arr[tuple(slobj)]
   [2020-06-22T00:36:45.759Z]             slobj[axis] = slice(obj, None)
   [2020-06-22T00:36:45.759Z]             slobj2 = [slice(None)]*ndim
   [2020-06-22T00:36:45.759Z]             slobj2[axis] = slice(obj+1, None)
   [2020-06-22T00:36:45.759Z]             new[tuple(slobj)] = arr[tuple(slobj2)]
   [2020-06-22T00:36:45.759Z]         else:
   [2020-06-22T00:36:45.759Z]             _obj = obj
   [2020-06-22T00:36:45.759Z]             obj = np.asarray(obj)
   [2020-06-22T00:36:45.759Z]             if obj.size == 0 and not 
isinstance(_obj, np.ndarray):
   [2020-06-22T00:36:45.759Z]                 obj = obj.astype(intp)
   [2020-06-22T00:36:45.759Z]     
   [2020-06-22T00:36:45.759Z]             if obj.dtype == bool:
   [2020-06-22T00:36:45.759Z]                 if obj.shape != (N,):
   [2020-06-22T00:36:45.759Z]                     raise ValueError('boolean 
array argument obj to delete '
   [2020-06-22T00:36:45.759Z]                                      'must be one 
dimensional and match the axis '
   [2020-06-22T00:36:45.759Z]                                      'length of 
{}'.format(N))
   [2020-06-22T00:36:45.759Z]     
   [2020-06-22T00:36:45.759Z]                 # optimization, the other branch 
is slower
   [2020-06-22T00:36:45.759Z]                 keep = ~obj
   [2020-06-22T00:36:45.759Z]             else:
   [2020-06-22T00:36:45.759Z]                 keep = ones(N, dtype=bool)
   [2020-06-22T00:36:45.759Z] >               keep[obj,] = False
   [2020-06-22T00:36:45.759Z] E               IndexError: arrays used as 
indices must be of integer (or boolean) type
   [2020-06-22T00:36:45.759Z] 
   [2020-06-22T00:36:45.759Z] 
C:\Python37\lib\site-packages\numpy\lib\function_base.py:4406: IndexError
   [2020-06-22T00:36:45.759Z] 
   [2020-06-22T00:36:45.759Z] During handling of the above exception, another 
exception occurred:
   [2020-06-22T00:36:45.759Z] 
   [2020-06-22T00:36:45.759Z] args = (), kwargs = {}, test_count = 1, 
env_seed_str = None, i = 0
   [2020-06-22T00:36:45.759Z] this_test_seed = 810322850, log_level = 10
   [2020-06-22T00:36:45.759Z] post_test_state = ('MT19937', array([1938474601, 
2158246084, 2260818444,   19860296, 1648467405,
   [2020-06-22T00:36:45.759Z]        3604725506,  725127881, 21902135..., 
1802122558,  653485402, 3067916522,
   [2020-06-22T00:36:45.759Z]        1738520349,  675050936, 3660368646, 
2725207562], dtype=uint32), 1, 0, 0.0)
   [2020-06-22T00:36:45.759Z] logger = <Logger common (DEBUG)>, test_count_msg 
= ''
   [2020-06-22T00:36:45.759Z] test_msg = 'Setting test np/mx/python random 
seeds, use MXNET_TEST_SEED=810322850 to reproduce.'
   [2020-06-22T00:36:45.759Z] 
   [2020-06-22T00:36:45.759Z]     @functools.wraps(orig_test)
   [2020-06-22T00:36:45.759Z]     def test_new(*args, **kwargs):
   [2020-06-22T00:36:45.759Z]         test_count = 
int(os.getenv('MXNET_TEST_COUNT', '1'))
   [2020-06-22T00:36:45.759Z]         env_seed_str = 
os.getenv('MXNET_TEST_SEED')
   [2020-06-22T00:36:45.759Z]         for i in range(test_count):
   [2020-06-22T00:36:45.759Z]             if seed is not None:
   [2020-06-22T00:36:45.759Z]                 this_test_seed = seed
   [2020-06-22T00:36:45.759Z]                 log_level = logging.INFO
   [2020-06-22T00:36:45.759Z]             elif env_seed_str is not None:
   [2020-06-22T00:36:45.759Z]                 this_test_seed = int(env_seed_str)
   [2020-06-22T00:36:45.759Z]                 log_level = logging.INFO
   [2020-06-22T00:36:45.759Z]             else:
   [2020-06-22T00:36:45.759Z]                 this_test_seed = 
np.random.randint(0, np.iinfo(np.int32).max)
   [2020-06-22T00:36:45.759Z]                 log_level = logging.DEBUG
   [2020-06-22T00:36:45.759Z]             post_test_state = 
np.random.get_state()
   [2020-06-22T00:36:45.759Z]             np.random.seed(this_test_seed)
   [2020-06-22T00:36:45.759Z]             mx.random.seed(this_test_seed)
   [2020-06-22T00:36:45.759Z]             random.seed(this_test_seed)
   [2020-06-22T00:36:45.759Z]             logger = default_logger()
   [2020-06-22T00:36:45.759Z]             # 'pytest --logging-level=DEBUG' 
shows this msg even with an ensuing core dump.
   [2020-06-22T00:36:45.759Z]             test_count_msg = '{} of {}: 
'.format(i+1,test_count) if test_count > 1 else ''
   [2020-06-22T00:36:45.759Z]             test_msg = ('{}Setting test 
np/mx/python random seeds, use MXNET_TEST_SEED={}'
   [2020-06-22T00:36:45.759Z]                         ' to 
reproduce.').format(test_count_msg, this_test_seed)
   [2020-06-22T00:36:45.759Z]             logger.log(log_level, test_msg)
   [2020-06-22T00:36:45.759Z]             try:
   [2020-06-22T00:36:45.759Z] >               orig_test(*args, **kwargs)
   [2020-06-22T00:36:45.759Z] 
   [2020-06-22T00:36:45.759Z] tests\python\unittest\common.py:223: 
   [2020-06-22T00:36:45.759Z] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
   [2020-06-22T00:36:45.759Z] windows_package\python\mxnet\util.py:298: in 
_with_np_shape
   [2020-06-22T00:36:45.759Z]     return func(*args, **kwargs)
   [2020-06-22T00:36:45.759Z] windows_package\python\mxnet\util.py:482: in 
_with_np_array
   [2020-06-22T00:36:45.759Z]     return func(*args, **kwargs)
   [2020-06-22T00:36:45.759Z] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
   [2020-06-22T00:36:45.759Z] 
   [2020-06-22T00:36:45.759Z] args = (), kwargs = {}
   [2020-06-22T00:36:45.759Z] 
   [2020-06-22T00:36:45.759Z]     @functools.wraps(func)
   [2020-06-22T00:36:45.759Z]     def _run_with_array_func_proto(*args, 
**kwargs):
   [2020-06-22T00:36:45.759Z]         if cur_np_ver >= np_1_17_ver:
   [2020-06-22T00:36:45.759Z]             try:
   [2020-06-22T00:36:45.759Z]                 func(*args, **kwargs)
   [2020-06-22T00:36:45.759Z]             except Exception as e:
   [2020-06-22T00:36:45.759Z]                 raise RuntimeError('Running 
function {} with NumPy array function protocol failed'
   [2020-06-22T00:36:45.759Z]                                    ' with 
exception {}'
   [2020-06-22T00:36:45.759Z] >                                  
.format(func.__name__, str(e)))
   [2020-06-22T00:36:45.759Z] E               RuntimeError: Running function 
test_np_array_function_protocol with NumPy array function protocol failed with 
exception arrays used as indices must be of integer (or boolean) type
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to