title: TensorFlow: How to concatenate tensors by duplicating one of the tensor?
body: <p>I would like to concatenate two tensors by duplicating one of the tensor. For example, I have two tensors of shape [2, 2, 3] and [2, 3]. The result should be in the shape of [2, 2, 6].</p>
  
  <pre><code>t1 = [[[ 1, 1, 1], [2, 2, 2]],
        [[ 3, 3, 3], [4, 4, 4]]]
  t2 = [[ 5, 5, 5], [6, 6, 6]]
  """
  t3 = # some tf ops
  t3 should be
  t3 = [[[ 1, 1, 1, 5, 5, 5], [2, 2, 2, 5, 5, 5]],
        [[ 3, 3, 3, 6, 6, 6], [4, 4, 4, 6, 6, 6]]]
  """
  </code></pre>
  
  <p>So If the two tensors are of shape [10, 5, 8] and [10, 3], the result should be of shape [10, 5, 11].</p>
  
  <p><strong>UPDATED</strong></p>
  
  <p>Another example:</p>
  
  <pre><code>t1 = np.reshape(np.arange(3*4*5), [3,4,5])
  t2 = np.reshape(np.arange(3*1*2), [3,2])
  """"
  t3 should be
    [[[  0.,   1.,   2.,   3.,   4.,   0.,   1.],
      [  5.,   6.,   7.,   8.,   9.,   0.,   1.],
      [ 10.,  11.,  12.,  13.,  14.,   0.,   1.],
      [ 15.,  16.,  17.,  18.,  19.,   0.,   1.]],
  
     [[ 20.,  21.,  22.,  23.,  24.,   2.,   3.],
      [ 25.,  26.,  27.,  28.,  29.,   2.,   3.],
      [ 30.,  31.,  32.,  33.,  34.,   2.,   3.],
      [ 35.,  36.,  37.,  38.,  39.,   2.,   3.]],
  
     [[ 40.,  41.,  42.,  43.,  44.,   4.,   5.],
      [ 45.,  46.,  47.,  48.,  49.,   4.,   5.],
      [ 50.,  51.,  52.,  53.,  54.,   4.,   5.],
      [ 55.,  56.,  57.,  58.,  59.,   4.,   5.]]]
  """
  </code></pre>