6e4b7e22eeb79f7e1c39d862f10ec3e61e51c979,fairseq/sequence_generator.py,SequenceGenerator,_decode,#SequenceGenerator#Any#Any#,317
Before Change
length = tokens.size(1)
// repeat the first length positions to fill batch
positions = self.positions[:length].view(1, length)
// wrap in Variables
tokens = Variable(tokens, volatile=True)
positions = Variable(positions, volatile=True)
avg_probs = None
avg_attn = None
for model, encoder_out in zip(self.models, encoder_outs):
After Change
avg_probs = None
avg_attn = None
for model, encoder_out in zip(self.models, encoder_outs):
if isinstance(model.decoder, FairseqIncrementalDecoder):
decoder_out, attn = model.decoder.incremental_forward(tokens, encoder_out)
else:
decoder_out, attn = model.decoder.forward(tokens, encoder_out)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: elbayadm/attn2d
Commit Name: 6e4b7e22eeb79f7e1c39d862f10ec3e61e51c979
Time: 2017-11-08
Author: myleott@fb.com
File Name: fairseq/sequence_generator.py
Class Name: SequenceGenerator
Method Name: _decode
Project Name: arraiy/torchgeometry
Commit Name: fadaeaf7513a5a9a6be5ee231df1b0fdb1ea147d
Time: 2019-03-26
Author: edgar.riba@gmail.com
File Name: torchgeometry/metrics/confusion_matrix.py
Class Name:
Method Name: confusion_matrix