goal:把(2, 3, 2)的matrix打平成(2, 3*2)的matrix
import numpy as np
x = np.arange(12).reshape((2, 3, 2))
Out[44]:
array([[[ 0, 1],
[ 2, 3],
[ 4, 5]],
[[ 6, 7],
[ 8, 9],
[10, 11]]])
x = x.reshape(x.shape[0],-1)
#x = x.reshape(x.shape[0], 3*2)
Out[47]:
array([[ 0, 1, 2, 3, 4, 5],
[ 6, 7, 8, 9, 10, 11]])