Closed
Description
Following up on pytorch/pytorch#61901 (comment). A design rule that NumPy, PyTorch and JAX seem to follow is:
Return identity if reduction has one, otherwise return nan for reductions that promote integers to floating point dtypes and raise an error for all other.
This is not specified anywhere, and I can't find a previous discussion on it. For element-wise functions there's a "Special Cases" section, but for reductions there isn't. @asmeurer does the test suite cover empty array input to functions at all?
Metadata
Metadata
Assignees
Labels
No labels