YouTip LogoYouTip

Pytorch Torch Nan_To_Num

# Replace NaN with 0 x = torch.tensor([1.0,float('nan'),3.0,float('inf'),float('-inf')]) result = torch.nan_to_num(x, nan=0.0) print(result)

Image 4: Pytorch torch Reference Pytorch torch Reference

← Pytorch Torch NansumPytorch Torch Mv β†’