original_docstring:  Dump weights of neural model as binary data.
  
          :return: 2-element tuple of binary data (`bytes` objects) containing weights of neural encoder and
          neural decoder respectively.
          
docstring: Dump weights of neural model as binary data.
docstring_tokens: Dump weights of neural model as binary data .
code: def dump_weights(self):
          """ Dump weights of neural model as binary data.
  
          :return: 2-element tuple of binary data (`bytes` objects) containing weights of neural encoder and
          neural decoder respectively.
          """
          check_is_fitted(self, ['input_token_index_', 'target_token_index_', 'reverse_target_char_index_',
                                 'max_encoder_seq_length_', 'max_decoder_seq_length_',
                                 'encoder_model_', 'decoder_model_'])
          tmp_weights_name = self.get_temp_name()
          try:
              if os.path.isfile(tmp_weights_name):
                  os.remove(tmp_weights_name)
              self.encoder_model_.save_weights(tmp_weights_name)
              with open(tmp_weights_name, 'rb') as fp:
                  weights_of_encoder = fp.read()
              os.remove(tmp_weights_name)
              self.decoder_model_.save_weights(tmp_weights_name)
              with open(tmp_weights_name, 'rb') as fp:
                  weights_of_decoder = fp.read()
              os.remove(tmp_weights_name)
              weights_as_bytearray = (weights_of_encoder, weights_of_decoder)
          finally:
              if os.path.isfile(tmp_weights_name):
                  os.remove(tmp_weights_name)
          return weights_as_bytearray
code_tokens: def dump_weights ( self ) : check_is_fitted ( self , [ 'input_token_index_' , 'target_token_index_' , 'reverse_target_char_index_' , 'max_encoder_seq_length_' , 'max_decoder_seq_length_' , 'encoder_model_' , 'decoder_model_' ] ) tmp_weights_name = self . get_temp_name ( ) try : if os . path . isfile ( tmp_weights_name ) : os . remove ( tmp_weights_name ) self . encoder_model_ . save_weights ( tmp_weights_name ) with open ( tmp_weights_name , 'rb' ) as fp : weights_of_encoder = fp . read ( ) os . remove ( tmp_weights_name ) self . decoder_model_ . save_weights ( tmp_weights_name ) with open ( tmp_weights_name , 'rb' ) as fp : weights_of_decoder = fp . read ( ) os . remove ( tmp_weights_name ) weights_as_bytearray = ( weights_of_encoder , weights_of_decoder ) finally : if os . path . isfile ( tmp_weights_name ) : os . remove ( tmp_weights_name ) return weights_as_bytearray
short_docstring: Dump weights of neural model as binary data.
short_docstring_tokens: Dump weights of neural model as binary data .
comment: """ Dump weights of neural model as binary data.
  
          :return: 2-element tuple of binary data (`bytes` objects) containing weights of neural encoder and
          neural decoder respectively.
          """