title: Convert 'int' to pytorch 'Variable' makes problems
body: <p>First project with pytorch and I got stuck trying to convert an MNIST label 'int' into a torch 'Variable'. Debugger says it has no dimension?!</p>
  
  <pre><code># numpy mnist data
  X_train, Y_train = read_data("training")
  X_test , Y_test  = read_data("testing")
  
  arr = np.zeros(5)
  for i in range(5):
      # in your training loop:
      costs_ = 0
      for k in range(10000):
          optimizer.zero_grad()                            # zero the gradient buffers
          a = torch.from_numpy(np.expand_dims(X_train[k].flatten(), axis=0)).float()
          b = torch.from_numpy(np.array(Y_train[k], dtype=np.float)).float()
          input = Variable(a)
          output = net(input)
          target = Variable(b)                             # PROBLEM!!
          loss = criterion(output, target)
          loss.backward()
          optimizer.step()                                 # Does the update
  
          costs_ += loss.data.numpy()
      arr[i] = costs_ 
      print(i)
  </code></pre>
  
  <p>Thrown error is: "RuntimeError: input and target have different number of elements: input[1 x 1] has 1 elements, while target[] has 0 elements at /b/wheel/pytorch-src/torch/lib/THNN/generic/MSECriterion.c:12"</p>