You have comparison function that will give you a 0-1 ByteTensor that contains a mask.
For example:
import torch
t = torch.rand(5, 10, 10)
tmax = t.max(-1, keepdim=True)[0]

mask = t.gt(tmax) # stritly greater
mask = t.ge(tmax) # greater or equal