title: AttributeError: 'Tensor' object has no attribute 'reshape'
body: <p>I want to write a denoising autoencoder and for the sake visualization purposes I would like to print out the corrupted images as well.</p>
  
  <p>This is the testing part where I want to show the corrupted image:</p>
  
  <pre><code>def corrupt(x):
      noise = tf.random_normal(shape=tf.shape(x), mean=0.0, stddev=0.2, dtype=tf.float32) 
      return x + noise
  
  # Testing
  # Encode and decode images from test set and visualize their reconstruction
  n = 10
  canvas_orig = np.empty((28, 28 * n))
  canvas_corrupt = np.empty((28, 28 * n))
  canvas_recon = np.empty((28, 28 * n))
  
  # MNIST test set
  batch_x, _ = mnist.test.next_batch(n)
  
  # Encode and decode the digit image and determine the test loss
  g, l = sess.run([Y, loss], feed_dict={X: batch_x})
  
  # Draw the generated digits
  for i in range(n):
      # Original images
      canvas_orig[0: 28, i * 28: (i + 1) * 28] = batch_x[i].reshape([28, 28])
  
      # Corrupted images
      canvas_corrupt[0: 28, i * 28: (i + 1) * 28] = corrupt(batch_x[i]).reshape([28, 28]) 
  
      # Reconstructed images
      canvas_recon[0: 28, i * 28: (i + 1) * 28] = g[i].reshape([28, 28])    
  
  print("Original Images")     
  plt.figure(figsize=(n, 1))
  plt.imshow(canvas_orig, origin="upper", cmap="gray")
  plt.show()
  
  print("Corrupted Images")     
  plt.figure(figsize=(n, 1))
  plt.imshow(canvas_corrupt, origin="upper", cmap="gray")
  plt.show()
  
  print("Reconstructed Images")
  plt.figure(figsize=(n, 1))
  plt.imshow(canvas_recon, origin="upper", cmap="gray")
  plt.show()
  </code></pre>
  
  <p>The error occurs on the following line:</p>
  
  <pre><code>canvas_corrupt[0: 28, i * 28: (i + 1) * 28] = corrupt(batch_x[i]).reshape([28, 28])
  </code></pre>
  
  <p>I really don't understand why it doesn't work because the statements above and beneath it look very similar and work perfectly.
  And the fact, that "reshape" is a function and not an attribute, confuses me a lot.</p>