MCPcopy Create free account
hub / github.com/YuminosukeSato/ironkernel / test_nan_reduce_sum

Function test_nan_reduce_sum

tests/python/test_special_values.py:44–48  ·  view source on GitHub ↗

NaN in array makes sum return NaN.

()

Source from the content-addressed store, hash-verified

42
43
44def test_nan_reduce_sum() -> None:
45 """NaN in array makes sum return NaN."""
46 buf = rt.asarray(np.array([1.0, float("nan"), 3.0]))
47 result = rt.go(kernel.sum(buf)).result().scalar()
48 assert math.isnan(result)
49
50
51def test_nan_through_channel() -> None:

Callers

nothing calls this directly

Calls 5

scalarMethod · 0.80
asarrayMethod · 0.45
resultMethod · 0.45
goMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected