torchcell.losses.multi_dim_nan_tolerant.NaNTolerantMSELoss

class NaNTolerantMSELoss[source]

Bases: Module

Per-dimension MSE loss that ignores NaN targets.

forward(y_pred: Tensor, y_true: Tensor) → tuple[Tensor, Tensor][source]

Compute MSE loss while properly handling NaN values.