title: Using expand_dims in pytorch
body: <p>I'm trying to tile a length 18 1 hot vector into a 40x40 grid.</p>
  
  <p>Looking at pytorch docs, expand dims seems to be what i need.</p>
  
  <p>But I cannot get it to work.  Any idea what I'm doing wrong?</p>
  
  <pre><code>one_hot = torch.zeros(18).unsqueeze(0)
  one_hot[0,1] = 1.0
  one_hot
  tensor([[0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]])
  one_hot.expand(-1,-1,40,40)
  Traceback (most recent call last):
    File "&lt;input&gt;", line 1, in &lt;module&gt;
  RuntimeError: The expanded size of the tensor (40) must match the existing size (18) at non-singleton dimension 3
  </code></pre>
  
  <p>I'm expecting a tensor of shape (1, 18, 40,40)</p>