|
34 | 34 | # B01: ===== ADD (x1, x2)
|
35 | 35 |
|
36 | 36 | _add_docstring_ = """
|
37 |
| -add(x1, x2, order='K') |
| 37 | +add(x1, x2, out=None, order='K') |
38 | 38 |
|
39 | 39 | Calculates the sum for each element `x1_i` of the input array `x1` with
|
40 | 40 | the respective element `x2_i` of the input array `x2`.
|
|
94 | 94 |
|
95 | 95 | # U11: ==== COS (x)
|
96 | 96 | _cos_docstring = """
|
97 |
| -cos(x, order='K') |
| 97 | +cos(x, out=None, order='K') |
98 | 98 |
|
99 | 99 | Computes cosine for each element `x_i` for input array `x`.
|
100 | 100 | """
|
|
106 | 106 |
|
107 | 107 | # B08: ==== DIVIDE (x1, x2)
|
108 | 108 | _divide_docstring_ = """
|
109 |
| -divide(x1, x2, order='K') |
| 109 | +divide(x1, x2, out=None, order='K') |
110 | 110 |
|
111 | 111 | Calculates the ratio for each element `x1_i` of the input array `x1` with
|
112 | 112 | the respective element `x2_i` of the input array `x2`.
|
|
128 | 128 |
|
129 | 129 | # B09: ==== EQUAL (x1, x2)
|
130 | 130 | _equal_docstring_ = """
|
131 |
| -equal(x1, x2, order='K') |
| 131 | +equal(x1, x2, out=None, order='K') |
132 | 132 |
|
133 | 133 | Calculates equality test results for each element `x1_i` of the input array `x1`
|
134 | 134 | with the respective element `x2_i` of the input array `x2`.
|
|
172 | 172 |
|
173 | 173 | # U17: ==== ISFINITE (x)
|
174 | 174 | _isfinite_docstring_ = """
|
| 175 | +isfinite(x, out=None, order='K') |
| 176 | +
|
175 | 177 | Computes if every element of input array is a finite number.
|
176 | 178 | """
|
177 | 179 |
|
|
181 | 183 |
|
182 | 184 | # U18: ==== ISINF (x)
|
183 | 185 | _isinf_docstring_ = """
|
| 186 | +isinf(x, out=None, order='K') |
| 187 | +
|
184 | 188 | Computes if every element of input array is an infinity.
|
185 | 189 | """
|
186 | 190 |
|
|
190 | 194 |
|
191 | 195 | # U19: ==== ISNAN (x)
|
192 | 196 | _isnan_docstring_ = """
|
| 197 | +isnan(x, out=None, order='K') |
| 198 | +
|
193 | 199 | Computes if every element of input array is a NaN.
|
194 | 200 | """
|
195 | 201 |
|
|
231 | 237 | # FIXME: implement B18
|
232 | 238 |
|
233 | 239 | # B19: ==== MULTIPLY (x1, x2)
|
234 |
| -# FIXME: implement B19 |
| 240 | +_multiply_docstring_ = """ |
| 241 | +multiply(x1, x2, out=None, order='K') |
| 242 | +
|
| 243 | +Calculates the product for each element `x1_i` of the input array `x1` |
| 244 | +with the respective element `x2_i` of the input array `x2`. |
| 245 | +
|
| 246 | +Args: |
| 247 | + x1 (usm_ndarray): |
| 248 | + First input array, expected to have numeric data type. |
| 249 | + x2 (usm_ndarray): |
| 250 | + Second input array, also expected to have numeric data type. |
| 251 | +Returns: |
| 252 | + usm_narray: |
| 253 | + an array containing the element-wise products. The data type of |
| 254 | + the returned array is determined by the Type Promotion Rules. |
| 255 | +""" |
| 256 | +multiply = BinaryElementwiseFunc( |
| 257 | + "multiply", ti._multiply_result_type, ti._multiply, _multiply_docstring_ |
| 258 | +) |
235 | 259 |
|
236 | 260 | # U25: ==== NEGATIVE (x)
|
237 | 261 | # FIXME: implement U25
|
|
268 | 292 |
|
269 | 293 | # U33: ==== SQRT (x)
|
270 | 294 | _sqrt_docstring_ = """
|
| 295 | +sqrt(x, out=None, order='K') |
| 296 | +
|
271 | 297 | Computes sqrt for each element `x_i` for input array `x`.
|
272 | 298 | """
|
273 | 299 |
|
|
276 | 302 | )
|
277 | 303 |
|
278 | 304 | # B23: ==== SUBTRACT (x1, x2)
|
279 |
| -# FIXME: implement B23 |
| 305 | +_subtract_docstring_ = """ |
| 306 | +subtract(x1, x2, out=None, order='K') |
| 307 | +
|
| 308 | +Calculates the difference bewteen each element `x1_i` of the input |
| 309 | +array `x1` and the respective element `x2_i` of the input array `x2`. |
| 310 | +
|
| 311 | +Args: |
| 312 | + x1 (usm_ndarray): |
| 313 | + First input array, expected to have numeric data type. |
| 314 | + x2 (usm_ndarray): |
| 315 | + Second input array, also expected to have numeric data type. |
| 316 | +Returns: |
| 317 | + usm_narray: |
| 318 | + an array containing the element-wise differences. The data type |
| 319 | + of the returned array is determined by the Type Promotion Rules. |
| 320 | +""" |
| 321 | +subtract = BinaryElementwiseFunc( |
| 322 | + "subtract", ti._subtract_result_type, ti._subtract, _subtract_docstring_ |
| 323 | +) |
| 324 | + |
280 | 325 |
|
281 | 326 | # U34: ==== TAN (x)
|
282 | 327 | # FIXME: implement U34
|
|
0 commit comments