0b0eabbfd972c9e3f6323bff9d39ac5fc3ba9cc7,transformer/Translator.py,Translator,translate_batch,#Translator#,52
Before Change
// size: (batch * beam) x seq
dec_partial_pos = dec_partial_pos.repeat(n_remaining_sents * beam_size, 1)
// wrap into a Variable
dec_partial_pos = Variable(dec_partial_pos.type(torch.LongTensor), volatile=True)
if self.opt.cuda:
dec_partial_seq = dec_partial_seq.cuda()
After Change
sz_b, len_s = src_seq.size()
src_seq = src_seq.repeat(1, sz_beam).view(sz_b * sz_beam, len_s)
sz_b, len_s, d_h = enc_output.size()
enc_output = enc_output.repeat(1, sz_beam, 1).view( sz_b * sz_beam, len_s, d_h)
//--- Prepare beams
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: jadore801120/attention-is-all-you-need-pytorch
Commit Name: 0b0eabbfd972c9e3f6323bff9d39ac5fc3ba9cc7
Time: 2018-08-23
Author: yhhuang@nlg.csie.ntu.edu.tw
File Name: transformer/Translator.py
Class Name: Translator
Method Name: translate_batch
Project Name: dmbee/seglearn
Commit Name: 56fb5f5ecfdaafc57b67db632004c6272f068e2e
Time: 2018-03-08
Author: david.mo.burns@gmail.com
File Name: seglearn/util.py
Class Name:
Method Name: check_ts_data
Project Name: dask/dask-image
Commit Name: 1a78285cd53a5988ee638937842246aa537bb576
Time: 2019-02-13
Author: jakirkham@gmail.com
File Name: dask_image/ndmeasure/__init__.py
Class Name:
Method Name: label