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

Function test_example4_reductions

tests/python/test_readme_examples.py:54–61  ·  view source on GitHub ↗

README Examples §4: sum, mean, min_reduce, max_reduce.

()

Source from the content-addressed store, hash-verified

52
53
54def test_example4_reductions() -> None:
55 """README Examples §4: sum, mean, min_reduce, max_reduce."""
56 buf = rt.asarray(np.arange(100, dtype=np.float64))
57
58 assert rt.go(kernel.sum(buf)).result().scalar() == 4950.0
59 assert rt.go(kernel.mean(buf)).result().scalar() == 49.5
60 assert rt.go(kernel.min_reduce(buf)).result().scalar() == 0.0
61 assert rt.go(kernel.max_reduce(buf)).result().scalar() == 99.0
62
63
64def test_example5_relu_where() -> None:

Callers

nothing calls this directly

Calls 8

scalarMethod · 0.80
asarrayMethod · 0.45
resultMethod · 0.45
goMethod · 0.45
sumMethod · 0.45
meanMethod · 0.45
min_reduceMethod · 0.45
max_reduceMethod · 0.45

Tested by

no test coverage detected