I have a tensor of size [n, c] having some nan values.
I want to replace the nan values with the max. value in the column that it lies.
I can think of a solution, but it consists of for loops. Is there a vectorized/pytorch-ic way of doing this?
Example:
Input:
[[0.25, nan, 0.10],
[0.75, 0.80, nan],
[0.00, nan, 0.30],
[nan, 0.00, 0.85]]
Output:
[[0.25, 0.80, 0.10],
[0.75, 0.80, 0.85],
[0.00, 0.80, 0.30],
[0.75, 0.00, 0.85]]