45e1418d553f26de3bf0d58c62bb954d17268c7e,torchsample/functions/affine.py,,F_affine2d,#Any#Any#Any#,9

Before Change


        coords[:,1] = coords[:,1] - (x.size(2) / 2. + 0.5)
    
    // apply the coordinate transformation
    new_coords = F.linear(coords, A, b)

    if center:
        // shift the coordinates back so origin is origin
        new_coords[:,0] = new_coords[:,0] + (x.size(1) / 2. + 0.5)

After Change


    
    2D Affine image transform on torch.autograd.Variable
    
    if matrix.dim() == 2:
        matrix = matrix.view(-1,2,3)

    A_batch = matrix[:,:,:2]
    if A_batch.size(0) != x.size(0):
        A_batch = A_batch.repeat(x.size(0),1,1)
    b_batch = matrix[:,:,2].unsqueeze(1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: ncullen93/torchsample
Commit Name: 45e1418d553f26de3bf0d58c62bb954d17268c7e
Time: 2017-05-03
Author: ncullen.th@dartmouth.edu
File Name: torchsample/functions/affine.py
Class Name:
Method Name: F_affine2d


Project Name: NVIDIA/sentiment-discovery
Commit Name: 8030eeca74b6634f2a60168516573912aaa9cd65
Time: 2018-11-20
Author: raulp@nvidia.com
File Name: model/model.py
Class Name: TransformerFeaturizer
Method Name: forward


Project Name: dmlc/dgl
Commit Name: cffa4034f580e33fe4295e9f1b54217e7fa724eb
Time: 2018-12-16
Author: zyhuang94@gmail.com
File Name: examples/pytorch/gcn/gcn.py
Class Name: NodeApplyModule
Method Name: forward