title: How can I randomly set elements to zero in TF?
body: <p>The pure numpy solution is:</p>
  <pre><code>import numpy as np
  
  data = np.random.rand(5,5) #data is of shape (5,5) with floats
  masking_prob = 0.5 #probability of an element to get masked
  indices = np.random.choice(np.prod(data.shape), replace=False, size=int(np.prod(data.shape)*masking_prob))
  data[np.unravel_index(indices, data)] = 0. #set to zero
  
  </code></pre>
  <p>How can I achieve this in TensorFlow?</p>