torch.nanmedian
torch.nanmedian(input) -> Tensor
Returns the median of the values in "input", ignoring "NaN" values.
This function is identical to "torch.median()" when there are no
   "NaN" values in "input". When "input" has one or more "NaN" values,
   "torch.median()" will always return "NaN", while this function will
   return the median of the non-"NaN" elements in "input". If all the
   elements in "input" are "NaN" it will also return "NaN".
Parameters:
      input (Tensor) -- the input tensor.
Example:
  >>> a = torch.tensor([1, float('nan'), 3, 2])
  >>> a.median()
  tensor(nan)
  >>> a.nanmedian()
  tensor(2.)

torch.nanmedian(input, dim=- 1, keepdim=False, *, out=None)
Returns a namedtuple "(values, indices)" where "values" contains
   the median of each row of "input" in the dimension "dim", ignoring
   "NaN" values, and "indices" contains the index of the median values
   found in the dimension "dim".