Is your TensorFlow too old? This is what I get in version 0.12rc0
a = tf.constant(np.arange(1,13).astype(np.float32), shape=[2, 2, 3])
b = tf.constant(np.arange(13,25).astype(np.float32), shape=[2, 3, 2])
sess.run(tf.matmul(a, b)) =>
array([[[ 94., 100.],
[ 229., 244.]],
[[ 508., 532.],
[ 697., 730.]]], dtype=float32)
source
share