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 a difference between the two operations?

res = tf.matmul(x,y)
res = tf.batch_matmul(x,y)
+4
source share
1 answer

tf.batch_matmuldeprecated in favor tf.matmulof version 0.12 and later, so there is no difference in later versions. In earlier versions it was required to introduce rank-2 for matmul, but for earlier ranks forbatch_matmul

+3
source

Source: https://habr.com/ru/post/1668277/


All Articles