在不使用dense的時候可以使用下面的方法生成全連接
attention_w = tf.Variable(tf.truncated_normal([hidden_size, attention_size], stddev=0.1), name='attention_w')
attention_b = tf.Variable(tf.constant(0.1, shape=[attention_size]), name='attention_b')
attention_u = tf.Variable(tf.truncated_normal([attention_size], stddev=0.1), name='attention_u')
這需要設置好shape,容易出現問題,代碼多