TypeError: where() missing 2 required positional argument: "input", "other"

torch.where(condition) works well in torch 1.3.1, but it throws TypeError in torch 1.2.0, but torch.where(condition) can be found in documentation of torch1.2.0:
doc of torch 1.2.0

How can I use torch.where(condition) in torch 1.2.0?

torch.nonzero(condition, as_tuple=True) doesn’t work in torch 1.2.0 either.

1 Like

It doesn’t work even in torch1.3.1, while working with onnx.