Hi @spanev
I’m using the latest version (1.2). I haven’t tried with another one.
According to the implementation, there should always be a 1. As there is always a maximum value when calling this line:  max_value, _ = torch.max(tensor_c,1) .  I will try with .detach() for mask2, but it shouldnt matter as mask2 is a copy of mask which is a tensor like tensor_c, which is already detached from the graph.