将tf.batch_matmul替换成tf.matmul的实现
我就废话不多说了,大家还是直接看代码吧~ import tensorflow as tf h_doc=tf.placeholder(tf.int32,[None,30,512]) h_query=tf.placeholder(tf.int32,[None,10,512]) temp = tf.matmul(h_doc, h_query, adjoint_b = True) # tf.batch_matmul(h_doc, h_query, adj_y=True) print(temp.get_shape()) (?, 30, 10) 补充知识:tf.matmul() 和tf.multip
下载地址
用户评论