title: TensorFlow: AttributeError: 'Tensor' object has no attribute 'shape'
body: <p>I have the following code which uses TensorFlow. After I reshape a list, it says </p>
  
  <blockquote>
    <p>AttributeError: 'Tensor' object has no attribute 'shape'</p>
  </blockquote>
  
  <p>when I try to print its shape.</p>
  
  <pre><code># Get the shape of the training data.
  print "train_data.shape: " + str(train_data.shape)
  train_data = tf.reshape(train_data, [400, 1])
  print "train_data.shape: " + str(train_data.shape)
  train_size,num_features = train_data.shape
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>train_data.shape: (400,) 
    Traceback (most recent call last):   File
    "", line 1, in    File
    "/home/shehab/Downloads/tools/python/pycharm-edu-2.0.4/helpers/pydev/pydev_import_hook.py",
    line 21, in do_import
        module = self._system_import(name, *args, **kwargs)   File "/home/shehab/Dropbox/py-projects/try-tf/logistic_regression.py", line
    77, in 
        print "train_data.shape: " + str(train_data.shape) AttributeError: 'Tensor' object has no attribute 'shape'</p>
  </blockquote>
  
  <p>Could anyone please tell me what I am missing?</p>