两者都是三个输入参数,第一个是判断条件,第二个是符合条件的设置值,第三个是不满足条件的设置值。
The difference is that, torch want to set the values of all the types of Tensor
mask_true = torch.where(torch.isnan(y_true), torch.full_like(y_true, 0), torch.full_like(y_true, 1))
mask_true = np.where(np.isnan(y_true), 0, 1)