Visit: https://elvanco.com/blog/how-to-get-the-count-of-an-element-in-a-tensor-in