torch.nan_to_num
torch.nan_to_num(input, nan=0.0, posinf=None, neginf=None, *, out=None) -> Tensor
Replaces "NaN", positive infinity, and negative infinity values in
   "input" with the values specified by "nan", "posinf", and "neginf",
   respectively. By default, "NaN"s are replaced with zero, positive
   infinity is replaced with the greatest finite value representable
   by "input"'s dtype, and negative infinity is replaced with the
   least finite value representable by "input"'s dtype.
Parameters:
      * input (Tensor) -- the input tensor.
  * **nan** (*Number**, **optional*) -- the value to replace
    "NaN"s with. Default is zero.

  * **posinf** (*Number**, **optional*) -- if a Number, the value
    to replace positive infinity values with. If None, positive
    infinity values are replaced with the greatest finite value
    representable by "input"'s dtype. Default is None.
