title: What does "unsqueeze" do in Pytorch?
body: <p>The <a href="https://pytorch.org/docs/stable/generated/torch.unsqueeze.html" rel="noreferrer">PyTorch documentation</a> says:</p>
  <blockquote>
  <p>Returns a new tensor with a dimension of size one inserted at the specified position. [...]</p>
  <pre><code>&gt;&gt;&gt; x = torch.tensor([1, 2, 3, 4])
  &gt;&gt;&gt; torch.unsqueeze(x, 0)
  tensor([[ 1,  2,  3,  4]])
  &gt;&gt;&gt; torch.unsqueeze(x, 1)
  tensor([[ 1],
          [ 2],
          [ 3],
          [ 4]])
  </code></pre>
  </blockquote>