#5359·burn

tensor: add NaN-ignoring reductions (nan_max, nan_min, ...)

Author: lagguiCreated Aug 13, 2026Updated Sep 29, 2026
Labelsenhancementfeature

Following #4814, the default floating-point extrema operations consistently propagate NaNs across backends.

We should consider adding explicit NaN-ignoring variants that provide a documented, consistent way to compute over non-NaN values.

Potential operations include:

  • nan_max / nan_min
  • nan_max_dim / nan_min_dim
  • nan_max_dim_with_indices / nan_min_dim_with_indices
  • nan_argmax / nan_argmin
  • nan_cumsum
  • nan_cumprod

The cummax / cummin operations don't have well established precedent, so I'd potentially leave them out for now.