The numpy version of hstack for a single matrix
c=np.array([[[2,3,4],[4,5,6]],[[20,30,40],[40,50,60]]])
np.hstack(c)
output:
array([[ 2, 3, 4, 20, 30, 40],
[ 4, 5, 6, 40, 50, 60]])
I am hoping to achieve the same behavior in TF.
c_t=tf.constant(c)
tf.stack(c_t,axis=1).eval()
I am getting the error
TypeError: Expected list for 'values' argument to 'pack' Op, not <tf.Tensor 'Const_14:0' shape=(2, 2, 3) dtype=int64>.
So I tried
tf.stack([c_t],axis=1).eval()
The output
array([[[[ 2, 3, 4],
[ 4, 5, 6]]],
[[[20, 30, 40],
[40, 50, 60]]]])
I am not looking for the behaviour. tf.reshape
and tf.concat
are not helping me either.