title: PyTorch method for returning element with highest count in a 1D tensor?
body: <p>Is there a built-in PyTorch method that takes a 1D tensor, and returns the element in the tensor with the highest count?</p>
  <p>For example, if we input <code>torch.tensor([2,2,2,3,4,5])</code>, the method should return <code>2</code> as it occurs the most. In case of a tie in frequency, the element with the lower value should be returned; inputting <code>torch.tensor([1,1,2,2,4,5])</code> should return <code>1</code>.</p>
  <p>Just to be clear, I only wish to know if there's an existing built-in PyTorch method that does exactly this. If there's no such method, please refrain from posting the solution, as I'd like to try solving it on my own.</p>