Array API compatible wrapper for :py:func:`np.bitwise_or `. See its docstring for more information.
(x1: Array, x2: Array, /)
| 176 | |
| 177 | |
| 178 | def bitwise_or(x1: Array, x2: Array, /) -> Array: |
| 179 | """ |
| 180 | Array API compatible wrapper for :py:func:`np.bitwise_or <numpy.bitwise_or>`. |
| 181 | |
| 182 | See its docstring for more information. |
| 183 | """ |
| 184 | if ( |
| 185 | x1.dtype not in _integer_or_boolean_dtypes |
| 186 | or x2.dtype not in _integer_or_boolean_dtypes |
| 187 | ): |
| 188 | raise TypeError("Only integer or boolean dtypes are allowed in bitwise_or") |
| 189 | # Call result type here just to raise on disallowed type combinations |
| 190 | _result_type(x1.dtype, x2.dtype) |
| 191 | x1, x2 = Array._normalize_two_args(x1, x2) |
| 192 | return Array._new(np.bitwise_or(x1._array, x2._array)) |
| 193 | |
| 194 | |
| 195 | # Note: the function name is different here |
no test coverage detected