a1c84511bce067d9a585d8ea31dba479f6421fb8,models/torch_resnet_cspn_nyu.py,Simple_Gudi_UpConv_Block,_up_pooling,#Simple_Gudi_UpConv_Block#Any#Any#,161

Before Change



    def _up_pooling(self, x, scale):

        x = nn.Upsample(scale_factor=scale, mode="nearest")(x)
        if self.oheight !=0 and self.owidth !=0:
            x = x.narrow(2,0,self.oheight)
            x = x.narrow(3,0,self.owidth)
//            x = x[:,:,0:self.oheight, 0:self.owidth].clone()
        mask = torch.zeros_like(x)
        for h in range(0, self.oheight, 2):
            for w in range(0, self.owidth, 2):
                mask[:,:,h,w] = 1
        x = torch.mul(mask, x)
        return x

    def forward(self, x):
        x = self._up_pooling(x, 2)

After Change



    def _up_pooling(self, x, scale):
        
        x = self._up_pool(x)
        if self.oheight !=0 and self.owidth !=0:
            x = x.narrow(2,0,self.oheight)
            x = x.narrow(3,0,self.owidth)
        return x
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 17

Instances


Project Name: XinJCheng/CSPN
Commit Name: a1c84511bce067d9a585d8ea31dba479f6421fb8
Time: 2019-07-04
Author: chengxinjing@baidu.com
File Name: models/torch_resnet_cspn_nyu.py
Class Name: Simple_Gudi_UpConv_Block
Method Name: _up_pooling


Project Name: XinJCheng/CSPN
Commit Name: a1c84511bce067d9a585d8ea31dba479f6421fb8
Time: 2019-07-04
Author: chengxinjing@baidu.com
File Name: models/torch_resnet_cspn_nyu.py
Class Name: Gudi_UpProj_Block_Cat
Method Name: _up_pooling


Project Name: XinJCheng/CSPN
Commit Name: a1c84511bce067d9a585d8ea31dba479f6421fb8
Time: 2019-07-04
Author: chengxinjing@baidu.com
File Name: models/torch_resnet_cspn_nyu.py
Class Name: Simple_Gudi_UpConv_Block_Last_Layer
Method Name: _up_pooling


Project Name: XinJCheng/CSPN
Commit Name: a1c84511bce067d9a585d8ea31dba479f6421fb8
Time: 2019-07-04
Author: chengxinjing@baidu.com
File Name: models/torch_resnet_cspn_nyu.py
Class Name: Simple_Gudi_UpConv_Block
Method Name: _up_pooling