210c33dd05e3b84aaaf6e1430777bc1833216d99,fasterai/generators.py,Unet34,_pad,#Unet34#Any#Any#,54

Before Change


        target_w = target.shape[3]*2

        if h<target_h or w<target_w:
            target = Variable(torch.zeros(x.shape[0], x.shape[1], target_h, target_w))
            target[:,:,:h,:w]=x
            return to_gpu(target)

        return x

After Change


        if h<target_h or w<target_w:
            padh = target_h-h if target_h > h else 0
            padw = target_w-w if target_w > w else 0
            return F.pad(x, (0,padw,0,padh), "constant",0)

        return x
           
    def forward(self, x_in: torch.Tensor):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: jantic/DeOldify
Commit Name: 210c33dd05e3b84aaaf6e1430777bc1833216d99
Time: 2018-11-04
Author: jsa169@gmail.com
File Name: fasterai/generators.py
Class Name: Unet34
Method Name: _pad


Project Name: scikit-image/scikit-image
Commit Name: a4804a43925bfa0fb58935344adfdd862a6ec889
Time: 2016-12-25
Author: devel@sciunto.org
File Name: skimage/filters/thresholding.py
Class Name:
Method Name: _mean_std


Project Name: SeanNaren/deepspeech.pytorch
Commit Name: 9ea14875825b2ab63a43ad2f0f5159d99df86d02
Time: 2019-07-29
Author: rasmus.arpe@gmail.com
File Name: model.py
Class Name: Lookahead
Method Name: forward