title: How to get the count of an element in a tensor in TensorFlow?
body: <p>I want to get the count of an element in a tensor, for example, <code>t = [1, 2, 0, 0, 0, 0]</code> (<code>t</code> is a tensor). I can get the amount 4 of zeros by calling <code>t.count(0)</code> in Python, but in TensorFlow, I can't find any functions to do this. How can I get the count of zeros?</p>