Solved by Pete_Florence in post #8 
              
              
                @truenicoco, torch.where() looks like it’'s in 0.4! http://pytorch.org/docs/master/torch.html#torch.where 
thanks others for examples of other options for 0.3 and before