| 1816 | } |
| 1817 | |
| 1818 | array array_equal( |
| 1819 | const array& a, |
| 1820 | const array& b, |
| 1821 | bool equal_nan, |
| 1822 | StreamOrDevice s /* = {} */) { |
| 1823 | if (a.shape() != b.shape()) { |
| 1824 | return array(false); |
| 1825 | } else { |
| 1826 | auto dtype = promote_types(a.dtype(), b.dtype()); |
| 1827 | equal_nan &= issubdtype(dtype, inexact); |
| 1828 | return all( |
| 1829 | array( |
| 1830 | a.shape(), |
| 1831 | bool_, |
| 1832 | std::make_shared<Equal>(to_stream(s), equal_nan), |
| 1833 | {astype(a, dtype, s), astype(b, dtype, s)}), |
| 1834 | false, |
| 1835 | s); |
| 1836 | } |
| 1837 | } |
| 1838 | |
| 1839 | array isnan(const array& a, StreamOrDevice s /* = {} */) { |
| 1840 | if (issubdtype(a.dtype(), integer) || a.dtype() == bool_) { |
nothing calls this directly
no test coverage detected