a = tf.placeholder(shape=[None, None, 48])
h, w, c = a.shape
b = tf.reshape(a, shape=[-1, 4, 4, 3]) # flatten the first two dimension and expand the last dimension
# do something
c = tf.reshape(b, shape=[h, w, 3]) # reshape back to the shape of a, but error occurs