7ee5c4cc9f2224f24f8121e78fdc969a2bf754e1,OpenNMT/onmt/Models.py,Decoder,forward,#Decoder#Any#Any#Any#,102
Before Change
hidden = enc_hidden
outputs = []
hidden = (hidden[0].squeeze(0), hidden[1].squeeze(0))
for emb_t in emb.chunk(emb.size(0)):
emb_t = emb_t.squeeze(0)
if self.input_feed:
emb_t = torch.cat([emb_t, output], 1)
// FIXME: multilayer
hidden = self.rnn(emb_t, hidden)
output = hidden[0]
output = self.attn(output, context.t())
output = self.dropout(output)
outputs += [output]
outputs = torch.cat([x.unsqueeze(0) for x in outputs])
return outputs
class NMTModel(nn.Container):
After Change
output = self.dropout(output)
outputs += [output]
outputs = torch.stack(outputs)
return outputs
class NMTModel(nn.Container):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: OpenNMT/OpenNMT-py
Commit Name: 7ee5c4cc9f2224f24f8121e78fdc969a2bf754e1
Time: 2017-01-11
Author: alerer@fb.com
File Name: OpenNMT/onmt/Models.py
Class Name: Decoder
Method Name: forward
Project Name: arraiy/torchgeometry
Commit Name: 85fd9ee010628a327a3e5b223106c3718c234cbd
Time: 2019-11-29
Author: ducha.aiki@gmail.com
File Name: kornia/utils/grid.py
Class Name:
Method Name: create_meshgrid3d