# 取平均(BiLSTM)
self.out = tf.concat(self.lstm_outputs, -1)
#self.sequence_length 句子长度,self. inputs 输入的句子
self.output = tf.reduce_sum(self.out, 1) / tf.reshape( tf.cast(self.sequence_length, dtype=tf.float32), [tf.shape(self.inputs)[0], 1])
# 取平均(BiLSTM)
self.out = tf.concat(self.lstm_outputs, -1)
#self.sequence_length 句子长度,self. inputs 输入的句子
self.output = tf.reduce_sum(self.out, 1) / tf.reshape( tf.cast(self.sequence_length, dtype=tf.float32), [tf.shape(self.inputs)[0], 1])