Hi Ptrblck,
I want to use Border22 with the values just higher than 0, i tried x[x>value] or x[:,x>value], but does not work. I need to have values just higher than zero and then pass it to the backward.()
this ( Border22[Border22>0]) give me again 0 value too.
        Border=torch.ones(fake.shape)
        Border[:,:,4-2:4+3,4-2:4+3]=0
        Border22=torch.mul(Border,fake).view(-1)
        Border22[Border22>0]
        Ones=torch.ones(1)
        loss2=criterion2()(Border22,Ones)
       loss2.bachward.()