685126644ae540be72eb662527269a0395e2c9eb,onmt/IO.py,,make_features,#Any#Any#,59

Before Change


def make_features(batch, fields):
    // TODO: This is bit hacky, add to batch somehow.
    f = ONMTDataset.collect_features(fields)
    cat = [batch.src[0]] + [batch.__dict__[k] for k in f]
    cat = [c.unsqueeze(2) for c in cat]
    return torch.cat(cat, 2)

After Change


    else:
        data = batch.__dict__[side]
    feat_start = side + "_feat_"
    features = sorted(batch.__dict__[k]
                      for k in batch.__dict__ if feat_start in k)
    levels = [data] + features
    return torch.cat([level.unsqueeze(2) for level in levels], 2)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 4

Instances


Project Name: OpenNMT/OpenNMT-py
Commit Name: 685126644ae540be72eb662527269a0395e2c9eb
Time: 2017-09-05
Author: bpeters@coli.uni-saarland.de
File Name: onmt/IO.py
Class Name:
Method Name: make_features


Project Name: asyml/texar
Commit Name: 293f90f5460e8f7ba06965d5c1b1304925b5a142
Time: 2017-12-02
Author: zichaoy@cs.cmu.edu
File Name: examples/tsf/utils.py
Class Name:
Method Name: get_batches


Project Name: PetrochukM/PyTorch-NLP
Commit Name: 2a1a6851344172e0134f3c5f4f5c1021975f2812
Time: 2018-03-11
Author: petrochukm@gmail.com
File Name: torchnlp/samplers/bucket_batch_sampler.py
Class Name: BucketBatchSampler
Method Name: __iter__


Project Name: keras-team/keras
Commit Name: 459d7fe3d7aeb065c42249e955a4053270e81814
Time: 2017-03-15
Author: francois.chollet@gmail.com
File Name: examples/babi_rnn.py
Class Name:
Method Name:


Project Name: keras-team/keras
Commit Name: 459d7fe3d7aeb065c42249e955a4053270e81814
Time: 2017-03-15
Author: francois.chollet@gmail.com
File Name: examples/babi_memnn.py
Class Name:
Method Name: