import tensorflow as tf
import numpy as np
sess = tf.Session()
tensor = tf.convert_to_tensor(np.array([[1001,1002,1003],[3,4,5]]), dtype=tf.float32)
sess.run(tensor)
# array([[ 1001., 1002., 1003.],
# [ 3., 4., 5.]], dtype=float32)
tensor_shape = tensor.get_shape()
tensor_shape
# TensorShape([Dimension(2), Dimension(3)])
print tensor_shape
# (2, 3)
num_rows = tensor_shape[0] # ???
num_cols = tensor_shape[1] # ???
tensor2 = tf.reshape(tensor, (num_rows*num_cols, 1))
TypeError: Expected int32, got Dimension(6) of type 'Dimension' instead.