Custom reduction is a binary operators, but differs from the existing
sparse_tensor.binary operation in significant ways.
- It does not deal with sparsity overlaps. It is given a finite set of non-empty values and must collapse them to a single value
- The nature of reduction requires a starting value (or identity value). This is normally zero for summation, but for the product needs to be 1.0. The custom code needs to explicitly pass an identity value.
The documentation can use a bit more explanation on why we added this.
For example, you can show that "regular" reductions can be expressed "the easy way", but this makes the sparse specifications more expressive (I want to avoid that newcomers think *all* reductions need to be defined this way)