(feat2, f, psize=2)
return feat1[:feat1.size(0)-psize, :feat1.size(1)-psize, :]
Reconstruct another batch feat1 from batch feat2 by f
    Params:
        feat2(torch.Tensor:shape (C*H*W)): feature 2
        f(torch.Tensor:shape (H*W*2)): f : 1->2
Reconstruct another batch feat1 from batch feat2 by f
    Params:
        feat2(torch.Tensor:shape (C*H*W)): feature 2
        f(torch.Tensor:shape (H*W*2)): f : 1->2
Reconstruct another batch feat1 from batch feat2 by f Params : feat2 ( torch . Tensor : shape ( C * H * W )) : feature 2 f ( torch . Tensor : shape ( H * W * 2 )) : f : 1 - > 2
def reconstruct_avg(feat2, f, psize=2):
    """
    Reconstruct another batch feat1 from batch feat2 by f
    Params:
        feat2(torch.Tensor:shape (C*H*W)): feature 2
        f(torch.Tensor:shape (H*W*2)): f : 1->2
    """
    #assert feat.size()[2:] == f.size(H)
    print(feat2.size())
    feat1 = torch.zeros_like(feat2)

    for y in range(feat2.size(0)):
        for x in range(feat2.size(1)):
            yp, xp = f[y,x]
            #print(yp,xp)
            batch_feat = feat2[yp:yp+psize,xp:xp+psize, :]
            feat1[y,x,:] = feat2[yp,xp,:] #batch_feat.reshape(psize*psize, feat2.size(2)).transpose(0,1).mean(dim=1)

    return feat1[:feat1.size(0)-psize, :feat1.size(1)-psize, :]
def reconstruct_avg ( feat2 , f , psize = 2 ) : #assert feat.size()[2:] == f.size(H) print ( feat2 . size ( ) ) feat1 = torch . zeros_like ( feat2 ) for y in range ( feat2 . size ( 0 ) ) : for x in range ( feat2 . size ( 1 ) ) : yp , xp = f [ y , x ] #print(yp,xp) batch_feat = feat2 [ yp : yp + psize , xp : xp + psize , : ] feat1 [ y , x , : ] = feat2 [ yp , xp , : ] #batch_feat.reshape(psize*psize, feat2.size(2)).transpose(0,1).mean(dim=1) return feat1 [ : feat1 . size ( 0 ) - psize , : feat1 . size ( 1 ) - psize , : ]