MCPcopy Create free account
hub / github.com/numpy/numpy / test_reducelike_byteorder_resolution

Method test_reducelike_byteorder_resolution

numpy/core/tests/test_ufunc.py:2438–2447  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2436 ufunc(a, c, out=out, casting="equiv")
2437
2438 def test_reducelike_byteorder_resolution(self):
2439 # See gh-20699, byte-order changes need some extra care in the type
2440 # resolution to make the following succeed:
2441 arr_be = np.arange(10, dtype=">i8")
2442 arr_le = np.arange(10, dtype="<i8")
2443
2444 assert np.add.reduce(arr_be) == np.add.reduce(arr_le)
2445 assert_array_equal(np.add.accumulate(arr_be), np.add.accumulate(arr_le))
2446 assert_array_equal(
2447 np.add.reduceat(arr_be, [1]), np.add.reduceat(arr_le, [1]))
2448
2449 def test_reducelike_out_promotes(self):
2450 # 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