This repository was archived by the owner on Nov 17, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 20
20
from __future__ import absolute_import
21
21
import functools
22
22
import numpy as _np
23
- from mxnet .test_utils import is_op_runnable
24
23
from . import numpy as mx_np # pylint: disable=reimported
25
24
from .numpy .multiarray import _NUMPY_ARRAY_FUNCTION_DICT , _NUMPY_ARRAY_UFUNC_DICT
26
25
@@ -214,6 +213,12 @@ def _register_array_function():
214
213
'trunc' ,
215
214
'floor' ,
216
215
'logical_not' ,
216
+ 'equal' ,
217
+ 'not_equal' ,
218
+ 'less' ,
219
+ 'less_equal' ,
220
+ 'greater' ,
221
+ 'greater_equal'
217
222
]
218
223
219
224
@@ -225,13 +230,6 @@ def _register_array_ufunc():
225
230
----------
226
231
https://numpy.org/neps/nep-0013-ufunc-overrides.html
227
232
"""
228
- if is_op_runnable ():
229
- _NUMPY_ARRAY_UFUNC_LIST .extend (['equal' ,
230
- 'not_equal' ,
231
- 'less' ,
232
- 'less_equal' ,
233
- 'greater' ,
234
- 'greater_equal' ])
235
233
dup = _find_duplicate (_NUMPY_ARRAY_UFUNC_LIST )
236
234
if dup is not None :
237
235
raise ValueError ('Duplicate operator name {} in _NUMPY_ARRAY_UFUNC_LIST' .format (dup ))
Original file line number Diff line number Diff line change 23
23
from mxnet import np
24
24
from mxnet .test_utils import assert_almost_equal
25
25
from mxnet .test_utils import use_np
26
+ from mxnet .test_utils import is_op_runnable
26
27
from common import assertRaises , with_seed
27
28
from mxnet .numpy_dispatch_protocol import with_array_function_protocol , with_array_ufunc_protocol
28
29
from mxnet .numpy_dispatch_protocol import _NUMPY_ARRAY_FUNCTION_LIST , _NUMPY_ARRAY_UFUNC_LIST
@@ -934,12 +935,13 @@ def _prepare_workloads():
934
935
_add_workload_logical_not (array_pool )
935
936
_add_workload_vdot ()
936
937
_add_workload_vstack (array_pool )
937
- _add_workload_equal (array_pool )
938
- _add_workload_not_equal (array_pool )
939
- _add_workload_greater (array_pool )
940
- _add_workload_greater_equal (array_pool )
941
- _add_workload_less (array_pool )
942
- _add_workload_less_equal (array_pool )
938
+ if is_op_runnable ():
939
+ _add_workload_equal (array_pool )
940
+ _add_workload_not_equal (array_pool )
941
+ _add_workload_greater (array_pool )
942
+ _add_workload_greater_equal (array_pool )
943
+ _add_workload_less (array_pool )
944
+ _add_workload_less_equal (array_pool )
943
945
944
946
945
947
_prepare_workloads ()
You can’t perform that action at this time.
0 commit comments