title: What is the equivalent tensorflow operation of this numpy array operation?
body: <p>So, for example, <code>y_pred</code> is a numpy array and I want this operation.</p>
  
  <pre><code>result = []
  for i in y_pred:
      i = np.where(i == i.max(), 1, 0)
      result.append(i)
  </code></pre>
  
  <p>The maximum number of each row in <code>y_pred</code> will become <code>1</code> and the rest will become <code>0</code>.</p>
  
  <p>How can I implement this operation if y_pred is a tensor?</p>