c2684e5cf3719d15ca5a13c1919642f96b55f177,python/baseline/pytorch/classify/model.py,WordClassifierBase,make_input,#WordClassifierBase#Any#,49

Before Change


        x = batch_dict["x"]
        y = batch_dict["y"]
        if type(x) == list:
            x = [torch.autograd.Variable(item.cuda()) for item in x]
        else:
            x = torch.autograd.Variable(x.cuda())
        y = torch.autograd.Variable(y.cuda())
        return x, y

After Change


        xch = batch_dict.get("xch")
        y = batch_dict.get("y")
        lengths = batch_dict.get("lengths")
        if self.gpu:
            x = x.cuda()
            if xch is not None:
                xch = xch.cuda()
            if y is not None:
                y = y.cuda()

        return x, xch, lengths, y

    def forward(self, input):
        // BxTxC
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: dpressel/mead-baseline
Commit Name: c2684e5cf3719d15ca5a13c1919642f96b55f177
Time: 2018-06-10
Author: dpressel@gmail.com
File Name: python/baseline/pytorch/classify/model.py
Class Name: WordClassifierBase
Method Name: make_input


Project Name: OpenNMT/OpenNMT-py
Commit Name: 3bc7e38ed98f3b7a13fcee2726ec38b27e5c4e1b
Time: 2017-06-23
Author: srush@sum1gpu02.rc.fas.harvard.edu
File Name: onmt/Models.py
Class Name: Encoder
Method Name: __init__


Project Name: rusty1s/pytorch_geometric
Commit Name: 66cc1f180558685930f93c612ce7ee1616cda73c
Time: 2017-11-20
Author: matthias.fey@tu-dortmund.de
File Name: examples/mnist_grid.py
Class Name:
Method Name: test