albanD:

Isn’t x already a full Tensor? So you have to compute it before giving it to torch.where() right?


I am actually doing something like torch.where(cond, f(x), g(y)), where f and g act element-wise and can be expensive. For example see the definitions of logerfc and logerfcx in this code snippet: How to call SciPy functions? 4