title: Drop a dimension of a tensor in Tensorflow
body: <p>I have a tensor that have shape <code>(50, 100, 1, 512)</code> and i want to reshape it or drop the third dimension so that the new tensor have shape <code>(50, 100, 512)</code>.</p>
  
  <p>I have tried <code>tf.slice</code> with <code>tf.squeeze</code>:</p>
  
  <pre><code>a = tf.slice(a, [50, 100, 1, 512], [50, 100, 1, 512])
  b = tf.squeeze(a)
  </code></pre>
  
  <p>Everything seem working when i tried to print the shape of <code>a</code> and <code>b</code> but when i start training my model this error came</p>
  
  <pre><code>tensorflow.python.framework.errors_impl.InvalidArgumentError: Expected size[0] in [0, 0], but got 50
       [[Node: Slice = Slice[Index=DT_INT32, T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"](MaxPool_2, Slice/begin, Slice/size)]]
  </code></pre>
  
  <p>Are there any problem with my <code>slice</code>. How can i fix it. Thanks</p>