title: How can I count the number of 1's and 0's in the second dimension of a PyTorch Tensor?
body: <p>I have a tensor with size: <code>torch.Size([64, 2941])</code>, which is 64 batches of 2941 elements.</p>
  
  <p>Across all 64 batches, I want to count the total number of 1s and 0s in the second dimension of the tensor, all the way to the 2941th so that I will have those counts as a tensor of size <code>torch.Size([2941])</code></p>
  
  <p>How do I do that?</p>