a0dadd2f2f5a2f443dfabdf696809d5e6ca8e2b5,ch12/libbots/model.py,,pack_batch,#Any#Any#Any#,117

Before Change


    output_seq_list = []
    for out in output_idx:
        seq = out[:-1]
        out_v = Variable(torch.LongTensor([seq]))
        if cuda:
            out_v = out_v.cuda()
        emb_out_v = embeddings(out_v)
        out_seq = rnn_utils.pack_padded_sequence(emb_out_v, [len(seq)], batch_first=True)
        output_seq_list.append(out_seq)
    return emb_input_seq, output_seq_list, input_idx, output_idx

After Change


    // prepare output sequences, with end token stripped
    output_seq_list = []
    for out in output_idx:
        output_seq_list.append(pack_input(out[:-1], embeddings, cuda))
    return emb_input_seq, output_seq_list, input_idx, output_idx


Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 3

Instances


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: a0dadd2f2f5a2f443dfabdf696809d5e6ca8e2b5
Time: 2018-01-14
Author: max.lapan@gmail.com
File Name: ch12/libbots/model.py
Class Name:
Method Name: pack_batch


Project Name: activatedgeek/LeNet-5
Commit Name: b9d7f39a752d23a7de60ea6d679812c401fab57e
Time: 2019-01-01
Author: 1sanyamkapoor@gmail.com
File Name: run.py
Class Name:
Method Name: train


Project Name: OpenNMT/OpenNMT-py
Commit Name: ab89e458bdec863f2dc2f7232ffd38d49758b31a
Time: 2018-06-08
Author: srush@seas.harvard.edu
File Name: onmt/Loss.py
Class Name:
Method Name: filter_shard_state


Project Name: ncullen93/torchsample
Commit Name: 2154d789ef0d79debe2cc522751ae7072e8b22dc
Time: 2017-04-28
Author: ncullen@modv-vlan533.0527.apn.wlan.wireless-pennnet.upenn.edu
File Name: torchsample/modules/super_module.py
Class Name: SuperModule
Method Name: predict_loader


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 72313bc158d57e1f36e2c17848338a3079982def
Time: 2018-02-20
Author: max.lapan@gmail.com
File Name: ch16/01_cartpole_es.py
Class Name:
Method Name: train_step