Reputation: 380
I'm trying to construct a neural network architecture with Tensorflow.
and I have a variable, type of Tensor.
Say,
a = <tf.Tensor shape(16, ?, 20) dtype=float32>
16 is batch size and an input is encoded into dimension of 20. but, there are different number of inputs.
Here, how can I change its dimension to (16, 20) by just mean pooling with respect of the second dimension which has different size.
Thank you.
Upvotes: 1
Views: 586
Reputation: 1303
reduce_mean?
a = tf.placeholder('float32', shape=(16, None, 20))
b = tf.reduce_mean(a, axis=1)
print b
output:
Tensor("Mean:0", shape=(16, 20), dtype=float32)
Upvotes: 3