f390cc34b75c2e5dd9b9db1b66ec41525174ee61,onmt/Translator.py,Translator,_runTarget,#Translator#Any#Any#,59
Before Change
tt = torch.cuda if self.opt.cuda else torch
goldScores = tt.FloatTensor(batch.batch_size).fill_(0)
decOut, decStates, attn = self.model.decoder(
batch.tgt[:-1], src, context, decStates)
// print(decOut.size(), batch.tgt[1:].data.size())
// aeq(decOut.size(), batch.tgt[1:].data.size())
After Change
_, src_lengths = batch.src
src = onmt.IO.make_features(batch, "src")
tgt_in = onmt.IO.make_features(batch, "tgt")[:-1]
// (1) run the encoder on the src
encStates, context = self.model.encoder(src, src_lengths)
decStates = self.model.init_decoder_state(context, encStates)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: OpenNMT/OpenNMT-py
Commit Name: f390cc34b75c2e5dd9b9db1b66ec41525174ee61
Time: 2017-09-05
Author: bpeters@coli.uni-saarland.de
File Name: onmt/Translator.py
Class Name: Translator
Method Name: _runTarget
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 43b377988116600e96d46d9eaae3e2d462fe2923
Time: 2019-10-29
Author: guillaumekln@users.noreply.github.com
File Name: opennmt/models/language_model.py
Class Name: LanguageModelInputter
Method Name: make_features
Project Name: OpenNMT/OpenNMT-py
Commit Name: 0741f0965037f5d845b69a70ce86af2e965e8f0f
Time: 2017-08-20
Author: srush@seas.harvard.edu
File Name: train.py
Class Name:
Method Name: eval