===== 1
mask = x == 3
mask = torch.cat([torch.zeros(mask.shape[0])[..., None].bool(), mask[:, :-1]], dim=1)

===== 2
row, col = torch.where(x == 3)
col += 1
mask = torch.zeros_like(x).bool()
mask[row, col] = True

===== 3
mask = torch.zeros_like(x).bool()
mask[:, 1:] = (x[..., :-1] == 3)