Reductions

As an intro to masked reductions, please find the document on reduction semantics here. In general, an operator is a reduction operator if it reduces one or more dimensions of the input tensor to a single value (e.g. think nanmean or nansum)

MaskedTensor currently supports the following reductions:

sum

Returns the sum of all elements in the input tensor.

mean

Returns the mean value of all elements in the input tensor.

amin

Returns the minimum value of each slice of the input tensor in the given dimension(s) dim.

amax

Returns the maximum value of each slice of the input tensor in the given dimension(s) dim.

prod

Returns the product of all elements in the input tensor.

The next ops to be implemented will be in the ones in the MaskedTensor Reduction RFC. If you would like any others implemented, please create a feature request with proposed input/output semantics!