title: Torch squeeze and the batch dimension
body: <p>does anyone here know if the <code>torch.squeeze</code> function respects the batch (e.g. first) dimension? From some inline code it seems it does not.. but maybe someone else knows the inner workings better than I do.</p>
  <p>Btw, the underlying problem is that I have tensor of shape <code>(n_batch, channel, x, y, 1)</code>. I want to remove the last dimension with a simple function, so that I end up with a shape of <code>(n_batch, channel, x, y)</code>.</p>
  <p>A reshape is of course possible, or even selecting the last axis. But I want to embed this functionality in a layer so that I can easily add it to a <code>ModuleList</code> or <code>Sequence</code> object.</p>
  <p>EDIT: just found out that for Tensorflow (2.5.0) the function <code>tf.linalg.diag</code> DOES respect batch dimension. Just a FYI that it might differ per function you are using</p>