title: Which part of Pytorch tensor represents channels?
body: <p>Surprisingly I have not found an answer to this question after looking around the internet. I am specifically interested in a 3d tensor. From doing my own experiments, I have found that when I create a tensor:</p>
  
  <pre><code>h=torch.randn(5,12,5)
  </code></pre>
  
  <p>And then put a convolutional layer on it defined as follows:</p>
  
  <pre><code>conv=torch.nn.Conv1d(12,48,3,padding=1)
  </code></pre>
  
  <p>The output is a (5,48,5) tensor. So, am I correct in assuming that for a 3d tensor in pytorch the middle number represents the number of channels?</p>
  
  <p>Edit: It seems that when running a conv2d, the input dimension is the first entry in the tensor, and I need to make it a 4d tensor (1,48,5,5) for example. Now I am very confused...</p>
  
  <p>Any help is much appreciated!</p>