title: Facing RuntimeError: invalid argument 3: sizes do not match
body: <p>My loss function is NLL loss,which takes in as inputs shape as  <code>[108416, 3]</code> and targets shape as <code>[108416]</code> and i get a resulting loss value of <code>2.2623</code> , but after the loss computation when i do the <code>optimizer.step()</code> call. I get</p>
  
  <pre><code>AND THIS IS LOSS Variable containing:
   2.2623
  [torch.cuda.FloatTensor of size 1 (GPU 0)]
  
  Traceback (most recent call last):
    File "/mnt/sdc1/project/training/fpr4x_liver_1x_2channel.py", line 336, in &lt;module&gt;
  train_fpr4x_liver_1x_2channel_model()
    File "/mnt/sdc1/project/training/fpr4x_liver_1x_2channel.py", line 245, in train_fpr4x_liver_1x_2channel_model
  est.run_experiment(opts.num_epochs, 5000,50)
    File "/media/redible/sdc/project/training/expt_utils.py", line 236, in run_experiment
  self.trainer.train()
    File "/media/redible/sdc/project/training/expt_utils.py", line 75, in train
  loss, outputs = self.net_mgr._forward_backward(network_inputs, loss_inputs)
    File "/media/redible/sdc/project/training/network_manager.py", line 19, in _forward_backward
  self.optimizer.step()
    File "/usr/local/lib/python3.5/dist-packages/torch/optim/adam.py", line 69, in step
  exp_avg.mul_(beta1).add_(1 - beta1, grad)
  RuntimeError: invalid argument 3: sizes do not match at /pytorch/torch/lib/THC/generated/../generic/THCTensorMathPointwise.cu:271
  </code></pre>
  
  <p>Not sure whats the cause of the error any help would be appreciated,Thanks in advance.</p>