title: How to expand dims in Torch (add dimension to tensor)
body: <p>I want to add dimensions to tensor, as in <code>numpy.expand_dims</code>. How can I do it? </p>
  
  <p>I can do it with following code:</p>
  
  <pre><code>a = torch.Tensor({{1,2}, {3,4}, {5,6}}) --array with shape (3,2)
  a_size_table = a:size():totable()
  table.insert(a_size_table, 1, 1)  -- adding `1` before first dimension
  a:reshape(torch.LongStorage(a_size_table)) -- returning array with shape (1,3,2)
  </code></pre>
  
  <p>It seems too complicated to me (compare it to <code>np.expand_dims(a,0)</code>). May be there is a better way to do it?</p>