MCPcopy Index your code
hub / github.com/numpy/numpy / test_reducelike_byteorder_resolution

Method test_reducelike_byteorder_resolution

numpy/_core/tests/test_ufunc.py:2645–2654  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2643 ufunc(a, c, out=out, casting="equiv")
2644
2645 def test_reducelike_byteorder_resolution(self):
2646 # See gh-20699, byte-order changes need some extra care in the type
2647 # resolution to make the following succeed:
2648 arr_be = np.arange(10, dtype=">i8")
2649 arr_le = np.arange(10, dtype="<i8")
2650
2651 assert np.add.reduce(arr_be) == np.add.reduce(arr_le)
2652 assert_array_equal(np.add.accumulate(arr_be), np.add.accumulate(arr_le))
2653 assert_array_equal(
2654 np.add.reduceat(arr_be, [1]), np.add.reduceat(arr_le, [1]))
2655
2656 def test_reducelike_out_promotes(self):
2657 # Check that the out argument to reductions is considered for

Callers

nothing calls this directly

Calls 3

assert_array_equalFunction · 0.90
accumulateMethod · 0.80
reduceMethod · 0.45

Tested by

no test coverage detected