`chunk` callable for (weighted) sum
(x, weights=None, dtype=None, computing_meta=False, **kwargs)
| 953 | def test_weighted_reduction(): |
| 954 | # Weighted reduction |
| 955 | def w_sum(x, weights=None, dtype=None, computing_meta=False, **kwargs): |
| 956 | """`chunk` callable for (weighted) sum""" |
| 957 | if computing_meta: |
| 958 | return x |
| 959 | if weights is not None: |
| 960 | x = x * weights |
| 961 | return np.sum(x, dtype=dtype, **kwargs) |
| 962 | |
| 963 | # Arrays |
| 964 | a = 1 + np.ma.arange(60).reshape(6, 10) |