Closed
Description
Per spec,
if include_initial is False, the returned array must have the same shape as x.
however, test_nan_propagation
expects the result to have an empty shape (i.e., be a scalar).
func_name = 'cumulative_sum', x = usm_ndarray([nan], dtype=float32), data = data(...)
@reproduce_failure('6.102.4', b'AXicY2BkQAcAACUAAg==')
@pytest.mark.parametrize(
"func_name", [f.__name__ for f in category_to_funcs["statistical"]]
)
@given(
x=hh.arrays(dtype=xps.floating_dtypes(), shape=hh.shapes(min_side=1)),
data=st.data(),
)
def test_nan_propagation(func_name, x, data):
func = getattr(xp, func_name)
set_idx = data.draw(
xps.indices(x.shape, max_dims=0, allow_ellipsis=False), label="set idx"
)
x[set_idx] = float("nan")
note(f"{x=}")
out = func(x)
> ph.assert_shape(func_name, out_shape=out.shape, expected=()) # sanity check
E AssertionError: out.shape=(1,), but should be () [cumulative_sum()]
Metadata
Metadata
Assignees
Labels
No labels