title: Difference betwee torch.unsqueeze and target.unsqueeze
body: <p>I am training a simple MLP by computing the MSE and get the following error:</p>
  <blockquote>
  <p>UserWarning: Using a target size (torch.Size([1])) that is different to the input size (torch.Size([1, 1])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.</p>
  </blockquote>
  <p>The following gives me the right solution
  <code>target = target.unsqueeze(1)</code> while <code>torch.unsqueeze(target,1)</code> does not. The former solution is from a previous <a href="https://stackoverflow.com/questions/57798033/valueerror-target-size-torch-size16-must-be-the-same-as-input-size-torch">question</a> and the latter comes from the <a href="https://pytorch.org/docs/stable/generated/torch.unsqueeze.html" rel="nofollow noreferrer">documentation</a></p>
  <p>Why does the latter fix the UserWarning message with the former doesn't?</p>