Find errors if any in tensorflow computation graph Given a computational graph in tensorflow find errors if any in the underlying code.  


import tensorflow as tf
import numpy as np
input = tf.placeholder(shape=(1, 224, 224, 3), dtype=tf.float32)
output = input + 5
with tf.Session() as sess:
  network_input = np.random.randint(5,  size=(700, 350, 3))
  out = sess.run(output, feed_dict = {input : network_input})  


The code is throwing error as the shape of the placeholder and the input given is not matching.
So for fixing it I am changing the shape of the place holder.
Is it the correct approach or the input given should be reshaped to the placeholder shape?
According to me, reshaping of the input in perfectly ok. 
If you are changing the shape of the parameter just to fulfill the requirements of the method parameter or for further processing of the logic, it is perfectly ok, as long as you know what you are sending and how it will be processed by further code. 

But in feed_dict, input and placeholder dimensions should be same otherwise you will get the compilation error.


  Note: In case you are not sure about the exact dimensions of your
  placeholder, you can use [None] as a dimension value while declaring a
  placeholder