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.