title: Counting number of occurrences in PyTorch Tensor. (Tensor is too big for Numpy)
body: <p>Is there any smart way to count the number of occurrences of each value in a very Large PyTorch Tensor? Tensor Size is <code>11701*300=3510300</code> or maybe increase or decrease.
  <code>TORCH.BINCOUNT, TORCH.UNIQUE and TORCH.UNIQUE_CONSECUTIVE</code> are not useful so far.</p>
  <p>BINCOUNT returns a different number of elements every time. Unique is also not useful as it returns unique values.</p>
  <p><a href="https://i.stack.imgur.com/nMhbY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nMhbY.png" alt="enter image description here" /></a></p>
  <p>This is what I meant when I said it returns different elements every time. If 5 elements will return 8 elements tensor, How I am supposed to know which elements are how many times. this is confusing for me. The official documentation has limited content and there is no other website, explains it.</p>
  <p>In the above picture. So, 5 is 2 times. 0 is? what 0 times? How to read this output. it doesn't make any sense to me.</p>
  <p><a href="https://i.stack.imgur.com/285jC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/285jC.png" alt="enter image description here" /></a></p>