original_docstring: 
          Generate a new decoder state based on the batch input
          :param pretrained_layer_states:
          :param buffering:
          :param type:
          :param batch: Batch object (may not contain target during decoding)
          :param beam_size: Size of beam used in beam search
          :return:
          
docstring: Generate a new decoder state based on the batch input
docstring_tokens: Generate a new decoder state based on the batch input
code: def create_decoder_state(self, batch, beam_size=1, type=1, buffering=True,
                               pretrained_layer_states=None, **kwargs):
          """
          Generate a new decoder state based on the batch input
          :param pretrained_layer_states:
          :param buffering:
          :param type:
          :param batch: Batch object (may not contain target during decoding)
          :param beam_size: Size of beam used in beam search
          :return:
          """
          src = batch.get('source')
          src_pos = batch.get('source_pos')
          tgt_atb = batch.get('target_atb')
          src_lang = batch.get('source_lang')
          tgt_lang = batch.get('target_lang')
  
          src_transposed = src.transpose(0, 1)
          encoder_output = self.encoder(src_transposed, input_pos=src_pos, input_lang=src_lang,
                                        pretrained_layer_states=pretrained_layer_states)
  
          print("[INFO] create Transformer decoding state with buffering", buffering)
          decoder_state = TransformerDecodingState(src, tgt_lang, encoder_output['context'], src_lang,
                                                   beam_size=beam_size, model_size=self.model_size,
                                                   type=type, buffering=buffering)
  
          return decoder_state
code_tokens: def create_decoder_state ( self , batch , beam_size = 1 , type = 1 , buffering = True , pretrained_layer_states = None , ** kwargs ) : src = batch . get ( 'source' ) src_pos = batch . get ( 'source_pos' ) tgt_atb = batch . get ( 'target_atb' ) src_lang = batch . get ( 'source_lang' ) tgt_lang = batch . get ( 'target_lang' ) src_transposed = src . transpose ( 0 , 1 ) encoder_output = self . encoder ( src_transposed , input_pos = src_pos , input_lang = src_lang , pretrained_layer_states = pretrained_layer_states ) print ( "[INFO] create Transformer decoding state with buffering" , buffering ) decoder_state = TransformerDecodingState ( src , tgt_lang , encoder_output [ 'context' ] , src_lang , beam_size = beam_size , model_size = self . model_size , type = type , buffering = buffering ) return decoder_state
short_docstring: Generate a new decoder state based on the batch input
short_docstring_tokens: Generate a new decoder state based on the batch input
comment: """
          Generate a new decoder state based on the batch input
          :param pretrained_layer_states:
          :param buffering:
          :param type:
          :param batch: Batch object (may not contain target during decoding)
          :param beam_size: Size of beam used in beam search
          :return:
          """