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