1. 首页
  2. 数据库
  3. 其它
  4. 将tf.batch_matmul替换成tf.matmul的实现

将tf.batch_matmul替换成tf.matmul的实现

上传者: 2020-12-21 00:57:19上传 PDF文件 125.29KB 热度 11次
我就废话不多说了,大家还是直接看代码吧~ 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
下载地址
用户评论