b = tf.constant([[[5.,6.],
[7.,8.]],
[[5., 6.],
[7., 8.]]])
a=tf.constant([[[1.,2.]],
[[1.,2.]]])
c=np.zeros((2,1,2))
b.shape=[2,2,2]
a.shape=[2,1,2]
需要注意的是,shape=(n, )的才是n维向量,shape(n,1)已经变成张量了。