|
54 | 54 | ] |
55 | 55 |
|
56 | 56 |
|
57 | | -def argmax(in_array1, axis=None, out=None): |
| 57 | +def argmax(x1, axis=None, out=None): |
58 | 58 | """ |
59 | 59 | Returns the indices of the maximum values along an axis. |
60 | 60 |
|
@@ -94,23 +94,22 @@ def argmax(in_array1, axis=None, out=None): |
94 | 94 |
|
95 | 95 | """ |
96 | 96 |
|
97 | | - is_dparray1 = isinstance(in_array1, dparray) |
98 | | - |
99 | | - if (not use_origin_backend(in_array1) and is_dparray1): |
| 97 | + x1_desc = dpnp.get_dpnp_descriptor(x1) |
| 98 | + if x1_desc: |
100 | 99 | if axis is not None: |
101 | | - checker_throw_value_error("argmax", "axis", type(axis), None) |
102 | | - if out is not None: |
103 | | - checker_throw_value_error("argmax", "out", type(out), None) |
104 | | - |
105 | | - result_obj = dpnp_argmax(in_array1) |
106 | | - result = dpnp.convert_single_elem_array_to_scalar(result_obj) |
| 100 | + pass |
| 101 | + elif out is not None: |
| 102 | + pass |
| 103 | + else: |
| 104 | + result_obj = dpnp_argmax(x1_desc) |
| 105 | + result = dpnp.convert_single_elem_array_to_scalar(result_obj) |
107 | 106 |
|
108 | | - return result |
| 107 | + return result |
109 | 108 |
|
110 | | - return numpy.argmax(in_array1, axis, out) |
| 109 | + return call_origin(numpy.argmax, x1, axis, out) |
111 | 110 |
|
112 | 111 |
|
113 | | -def argmin(in_array1, axis=None, out=None): |
| 112 | +def argmin(x1, axis=None, out=None): |
114 | 113 | """ |
115 | 114 | Returns the indices of the minimum values along an axis. |
116 | 115 |
|
@@ -150,17 +149,16 @@ def argmin(in_array1, axis=None, out=None): |
150 | 149 |
|
151 | 150 | """ |
152 | 151 |
|
153 | | - is_dparray1 = isinstance(in_array1, dparray) |
154 | | - |
155 | | - if (not use_origin_backend(in_array1) and is_dparray1): |
| 152 | + x1_desc = dpnp.get_dpnp_descriptor(x1) |
| 153 | + if x1_desc: |
156 | 154 | if axis is not None: |
157 | | - checker_throw_value_error("argmin", "axis", type(axis), None) |
158 | | - if out is not None: |
159 | | - checker_throw_value_error("argmin", "out", type(out), None) |
160 | | - |
161 | | - result_obj = dpnp_argmin(in_array1) |
162 | | - result = dpnp.convert_single_elem_array_to_scalar(result_obj) |
| 155 | + pass |
| 156 | + elif out is not None: |
| 157 | + pass |
| 158 | + else: |
| 159 | + result_obj = dpnp_argmin(x1_desc) |
| 160 | + result = dpnp.convert_single_elem_array_to_scalar(result_obj) |
163 | 161 |
|
164 | | - return result |
| 162 | + return result |
165 | 163 |
|
166 | | - return numpy.argmin(in_array1, axis, out) |
| 164 | + return call_origin(numpy.argmin, x1, axis, out) |
0 commit comments