b5486aaea994960688152e91fbab7699dc04e8c1,onmt/Models.py,Decoder,forward,#Decoder#Any#Any#Any#Any#,276

Before Change


            assert emb.dim() == 3

            // TODO: context_gate, coverage and copy
            assert self.context_gate is None
            assert not self._coverage
            assert not self._copy
            assert state.coverage is None

After Change


                context.transpose(0, 1)                     // (batch, s_len, d)
            )

            if self.context_gate is not None:
                outputs = self.context_gate(
                    emb.view(-1, emb.size(2)),
                    rnn_output.view(-1, rnn_output.size(2)),
                    attn_outputs.view(-1, attn_outputs.size(2))
                )
                outputs = outputs.view(t_len, n_batch, self.hidden_size)
                outputs = self.dropout(outputs)
            else:
                outputs = self.dropout(attn_outputs)        // (t_len, batch, d)
            state = RNNDecoderState(hidden, outputs[-1].unsqueeze(0), None)
            attns["std"] = attn_scores

        return outputs, state, attns
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: OpenNMT/OpenNMT-py
Commit Name: b5486aaea994960688152e91fbab7699dc04e8c1
Time: 2017-08-14
Author: taolei@csail.mit.edu
File Name: onmt/Models.py
Class Name: Decoder
Method Name: forward


Project Name: OpenNMT/OpenNMT-py
Commit Name: c88688032b3173bb140677e0e4e7b481efd3a5b9
Time: 2017-07-05
Author: srush@sum1gpu01.rc.fas.harvard.edu
File Name: onmt/modules/MultiHeadedAttn.py
Class Name: MultiHeadedAttention
Method Name: forward


Project Name: OpenNMT/OpenNMT-py
Commit Name: 3dc20bc15b767ad60edfc15154b630dbef8b79cc
Time: 2017-12-12
Author: dengyuntian@gmail.com
File Name: onmt/IO.py
Class Name:
Method Name: read_img_file