torch.nanquantile
- torch.nanquantile(input, q, dim=None, keepdim=False, *, interpolation='linear', out=None)
This is a variant of torch.quantile() that “ignores” NaN values,
computing the quantiles q as if NaN values in input did
not exist. If all values in a reduced row are NaN then the quantiles for
that reduction will be NaN. See the documentation for torch.quantile().
Example:
>>> t = torch.tensor([float('nan'), 1, 2])
>>> t.quantile(0.5)
tensor(nan)
>>> t.nanquantile(0.5)
tensor(1.5000)
>>> t = torch.tensor