This looks better
```
        tp_sum = np.multiply(np.logical_and(y_true, y_pred),
                             sum_weight).sum(axis=sum_axis, dtype=dtype))
        pred_sum = y_pred.multiply(sum_weight).sum(axis=sum_axis, dtype=dtype)
        true_sum = y_true.multiply(sum_weight).sum(axis=sum_axis, dtype=dtype)
```