Array API compatible wrapper for :py:func:`np.divide `. See its docstring for more information.
(x1: Array, x2: Array, /)
| 275 | |
| 276 | |
| 277 | def divide(x1: Array, x2: Array, /) -> Array: |
| 278 | """ |
| 279 | Array API compatible wrapper for :py:func:`np.divide <numpy.divide>`. |
| 280 | |
| 281 | See its docstring for more information. |
| 282 | """ |
| 283 | if x1.dtype not in _floating_dtypes or x2.dtype not in _floating_dtypes: |
| 284 | raise TypeError("Only floating-point dtypes are allowed in divide") |
| 285 | # Call result type here just to raise on disallowed type combinations |
| 286 | _result_type(x1.dtype, x2.dtype) |
| 287 | x1, x2 = Array._normalize_two_args(x1, x2) |
| 288 | return Array._new(np.divide(x1._array, x2._array)) |
| 289 | |
| 290 | |
| 291 | def equal(x1: Array, x2: Array, /) -> Array: |