Reputation: 3944
I'm using the following reshape in my model:
data = tf.placeholder(tf.float32, shape = (BATCH_SIZE, N_CHUNK, WIN * N_SENSOR))
data_flattened = tf.reshape(data, [BATCH_SIZE*N_CHUNK, WIN*N_SENSOR])
Now I want N_CHUNK to be variable (i.e. NONE in the dimension). How do I implement the reshape? Does the None dimension must be the first dimension?
Upvotes: 0
Views: 1844
Reputation: 5808
You can use tf.shape
to get a shape as an integer Tensor.
So in your example:
data = tf.placeholder(tf.float32, shape = (BATCH_SIZE, None, WIN * N_SENSOR))
data_flattened = tf.reshape(data, [BATCH_SIZE*tf.shape(data)[1], WIN*N_SENSOR])
Upvotes: 2