7a4f4148317f7274c0c88095c037e93f95b1d00d,python/baseline/pytorch/classify/model.py,LSTMModel,make_input,#LSTMModel#Any#,202

Before Change


            xch = xch[perm_idx]
        if y is not None:
            y = y[perm_idx]
        if self.gpu:
            x = x.cuda()
            if xch is not None:
                xch = xch.cuda()
            if y is not None:
                y = y.cuda()

        if y is not None:
            y = y.contiguous()

        return x, xch, lengths, y

After Change


        return hidden

    def make_input(self, batch_dict):
        inputs = super(LSTMModel).make_input(batch_dict)
        lengths = inputs["lengths"]
        lengths, perm_idx = lengths.sort(0, descending=True)
        for k, value in inputs.items():
            inputs[k] = value[perm_idx]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: dpressel/mead-baseline
Commit Name: 7a4f4148317f7274c0c88095c037e93f95b1d00d
Time: 2018-09-25
Author: dpressel@gmail.com
File Name: python/baseline/pytorch/classify/model.py
Class Name: LSTMModel
Method Name: make_input


Project Name: dpressel/mead-baseline
Commit Name: 029fdb5624fafee03a59f49d86b676f25851febf
Time: 2017-11-22
Author: dpressel@gmail.com
File Name: python/baseline/pytorch/classify/train.py
Class Name: ClassifyTrainerPyTorch
Method Name: _test


Project Name: dpressel/mead-baseline
Commit Name: 029fdb5624fafee03a59f49d86b676f25851febf
Time: 2017-11-22
Author: dpressel@gmail.com
File Name: python/baseline/pytorch/classify/train.py
Class Name: ClassifyTrainerPyTorch
Method Name: _train