

def test_nelements_array(data):
    lhs = compute(s.nelements(axis=1), data)
    rhs = data.shape[1]
    np.testing.assert_array_equal(lhs, rhs)
    lhs = compute(s.nelements(axis=0), data)
    rhs = data.shape[0]
    np.testing.assert_array_equal(lhs, rhs)
    lhs = compute(s.nelements(axis=(0, 1)), data)
    rhs = np.prod(data.shape)
    np.testing.assert_array_equal(lhs, rhs)

dataset/ETHPy150Open blaze/blaze/blaze/compute/tests/test_h5py.py test_nelements_array/original