title: Unintentional dimension added for tf.nn.conv1d
body: <p>The two tensors I'm feeding into <code>tf.nn.conv1d()</code> are <code>x</code> and <code>kernel</code> with sizes [16,512,32] and [1,1,32] respectively.  I've been able to run this code on my local machine, but I get an error when running it on a remote cluster.  </p>
  
  <p>I get a Value Error stating that the dimensions must be equal.  The message shows the resulting shapes for <code>x</code> and <code>kernel</code> as [16,1,512,32] and [1,1,1,32] respectively.</p>
  
  <ol>
  <li>Both machines are running the same version of <code>tensorflow-gpu-1.14.0</code> and <code>python-3.6</code>.</li>
  <li>I've printed the tensor shapes and they are confirmed to be the anticipated sizes.</li>
  </ol>
  
  <p>The wrapper is shown below that I'm calling within my code:
  <code>filter_size =1</code>
  <code>input_dim = 32</code>
  <code>output_dim = 32</code></p>
  
  <pre><code>     def conv1d_linear(self,x, filter_size,input_dim,output_dim,stride=1,name = 'conv1d_linear'):
          with tf.variable_scope(name):
              # Conv1D wrapper, with bias and no activation
              print(x)
              kernel = tf.get_variable('kernel', shape = [filter_size, input_dim, output_dim],initializer=tf.contrib.layers.xavier_initializer())
              print(kernel)
              bias =  tf.get_variable('bias', shape = [output_dim],initializer=tf.contrib.layers.xavier_initializer())
              x = tf.nn.conv1d(x, kernel, stride=stride, padding='SAME')
              x = tf.nn.bias_add(x, bias)
              x = tf.contrib.layers.batch_norm(x)
              return x 
  
  </code></pre>
  
  <p>Error Message</p>
  
  <pre><code>Using TensorFlow backend.
  Tensorflow Version: 1.14.0
  Building model...
  Tensor("stfnet/resstack0/stft_pool0/Relu:0", shape=(16, 512, 32), dtype=float32, device=/device:GPU:0)
  &lt;tf.Variable 'stfnet/resstack1/init_conv_lin0/kernel:0' shape=(1, 1, 32) dtype=float32_ref&gt;
  Traceback (most recent call last):
    File "/nv/hp20/nblinn6/.conda/envs/mytfenv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1659, in _create_c_op
      c_op = c_api.TF_FinishOperation(op_desc)
  tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimensions must be equal, but are 32 and 1 for 'stfnet/resstack1/init_conv_lin0/conv1d/Conv2D' (op: 'Conv2D') with input shapes: [16,1,512,32], [1,1,1,32].
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/nv/hp20/nblinn6/data/MODID_mystfresnet6_final_PB_2gpu.py", line 529, in &lt;module&gt;
      mymodel.train_init()
    File "/nv/hp20/nblinn6/data/MODID_mystfresnet6_final_PB_2gpu.py", line 413, in train_init
      self.logits_train = self.ModIDNet(self.batch_feature[0:int(self.gpu_batch_size)],self.tau,self.keep_rate,train = True,reuse = reuse_flg,name = 'stfnet')
    File "/nv/hp20/nblinn6/data/MODID_mystfresnet6_final_PB_2gpu.py", line 340, in ModIDNet
      x = self.resstack(x,tau,self.sensor_axis,self.maps[1],reuse = reuse,series_size = 512,name = 'resstack1')   
    File "/nv/hp20/nblinn6/data/MODID_mystfresnet6_final_PB_2gpu.py", line 310, in resstack
      x1 = self.conv1d_linear(x,1,map_in,map_out, name = 'init_conv_lin0')
    File "/nv/hp20/nblinn6/data/MODID_mystfresnet6_final_PB_2gpu.py", line 302, in conv1d_linear
      x = tf.nn.conv1d(x, kernel, stride=stride, padding='SAME')
    File "/nv/hp20/nblinn6/.conda/envs/mytfenv/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 574, in new_func
      return func(*args, **kwargs)
    File "/nv/hp20/nblinn6/.conda/envs/mytfenv/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 574, in new_func
      return func(*args, **kwargs)
    File "/nv/hp20/nblinn6/.conda/envs/mytfenv/lib/python3.6/site-packages/tensorflow/python/ops/nn_ops.py", line 3482, in conv1d
      data_format=data_format)
    File "/nv/hp20/nblinn6/.conda/envs/mytfenv/lib/python3.6/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 1026, in conv2d
      data_format=data_format, dilations=dilations, name=name)
    File "/nv/hp20/nblinn6/.conda/envs/mytfenv/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
      op_def=op_def)
    File "/nv/hp20/nblinn6/.conda/envs/mytfenv/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
      return func(*args, **kwargs)
    File "/nv/hp20/nblinn6/.conda/envs/mytfenv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
      op_def=op_def)
    File "/nv/hp20/nblinn6/.conda/envs/mytfenv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1823, in __init__
      control_input_ops)
    File "/nv/hp20/nblinn6/.conda/envs/mytfenv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1662, in _create_c_op
      raise ValueError(str(e))
  ValueError: Dimensions must be equal, but are 32 and 1 for 'stfnet/resstack1/init_conv_lin0/conv1d/Conv2D' (op: 'Conv2D') with input shapes: [16,1,512,32], [1,1,1,32].
  </code></pre>