(self, tgt, memory_bank, state, memory_lengths=None,
                step=None)
return (EnsembleDecoderOutput(outputs),
                EnsembleDecoderState(states),
                mean_attns)
See :obj:`RNNDecoderBase.forward()`
See :obj:`RNNDecoderBase.forward()`
See : obj : RNNDecoderBase . forward ()
def forward(self, tgt, memory_bank, state, memory_lengths=None,
                step=None):
        """ See :obj:`RNNDecoderBase.forward()` """
        # Memory_lengths is a single tensor shared between all models.
        # This assumption will not hold if Translator is modified
        # to calculate memory_lengths as something other than the length
        # of the input.
        outputs, states, attns = zip(*[
            model_decoder.forward(
                tgt, memory_bank[i], state[i], memory_lengths, step=step)
            for (i, model_decoder)
            in enumerate(self.model_decoders)])
        mean_attns = self.combine_attns(attns)
        return (EnsembleDecoderOutput(outputs),
                EnsembleDecoderState(states),
                mean_attns)
def forward ( self , tgt , memory_bank , state , memory_lengths = None , step = None ) : # Memory_lengths is a single tensor shared between all models. # This assumption will not hold if Translator is modified # to calculate memory_lengths as something other than the length # of the input. outputs , states , attns = zip ( * [ model_decoder . forward ( tgt , memory_bank [ i ] , state [ i ] , memory_lengths , step = step ) for ( i , model_decoder ) in enumerate ( self . model_decoders ) ] ) mean_attns = self . combine_attns ( attns ) return ( EnsembleDecoderOutput ( outputs ) , EnsembleDecoderState ( states ) , mean_attns )