ef17941545c6d742de717d9769b2a412d9924e4e,fairseq/sequence_generator.py,SequenceGenerator,_decode,#SequenceGenerator#Any#Any#Any#,495

Before Change


        avg_attn = None

        for model, encoder_out in zip(self.models, encoder_outs):
            with torch.no_grad():
                if incremental_states[model] is not None:
                    decoder_out = list(model.decoder(tokens, encoder_out, incremental_states[model]))
                else:
                    decoder_out = list(model.decoder(tokens, encoder_out))
                decoder_out[0] = decoder_out[0][:, -1, :]
                attn = decoder_out[1]

            probs = model.get_normalized_probs(decoder_out, log_probs=False).data
            if avg_probs is None:
                avg_probs = probs
            else:

After Change


        return finalized

    def _decode(self, tokens, encoder_outs, incremental_states):
        if len(self.models) == 1:
            return self._decode_one(tokens, self.models[0], encoder_outs[0], incremental_states, log_probs=True)

        avg_probs = None
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: elbayadm/attn2d
Commit Name: ef17941545c6d742de717d9769b2a412d9924e4e
Time: 2018-06-15
Author: myleott@fb.com
File Name: fairseq/sequence_generator.py
Class Name: SequenceGenerator
Method Name: _decode


Project Name: rtqichen/torchdiffeq
Commit Name: 1b93cfeca5f2503eafc4ec773353254cf077fb9f
Time: 2020-07-28
Author: 33688385+patrick-kidger@users.noreply.github.com
File Name: torchdiffeq/_impl/rk_common.py
Class Name:
Method Name: _runge_kutta_step