[英]What is the difference between tf.matmul and tf.batch_matmul in Tensorflow?
For example if I have the following data: 例如,如果我有以下数据:
x = tf.placeholder("float", [None, n, n])
y = tf.placeholder("float", [None, n, n])
Is there any difference between the two operations? 两种操作之间有什么区别吗?
res = tf.matmul(x,y)
res = tf.batch_matmul(x,y)
tf.batch_matmul
is deprecated in favor of tf.matmul
in version 0.12 and later so no difference in later versions. 不推荐使用
tf.batch_matmul
而推荐使用0.12和更高版本中的tf.matmul
,因此在更高版本中没有区别。 Earlier versions required rank-2 inputs for matmul
but allowed larger ranks for batch_matmul
较早的版本要求
matmul
等级为2的输入,但允许batch_matmul
为更大的等级
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.