torch.where documentation states that x and y can be either a tensor or a scalar. However, it doesn't seem to support float32 scalar.
import torch
x = torch.randn(3, 2) # x is of type torch.float32
torch.where(x>0, 0, x) # RuntimeError: expected scalar type long long but found float
# torch.where(x>0, 0.0, x) # RuntimeError: expected scalar type double but found float
My question is how to use float32 scalar?