To get the shape as a list of ints, do tensor.get_shape().as_list()
.
To complete your tf.shape()
call, try tensor2 = tf.reshape(tensor, tf.TensorShape([num_rows*num_cols, 1]))
. Or you can directly do tensor2 = tf.reshape(tensor, tf.TensorShape([-1, 1]))
where its first dimension can be inferred.