title: How to sample in Tensorflow by custom probability distribution?
body: <p>I have a vector e.g., <code>V = [10, 30, 20, 50]</code> of N elements and a probability vector <code>P = [.2, .3, .1, .4]</code>. In tensorflow, how can I randomly sample K elements from  V that obey the given probability distribution P? I want the sampling to be done with replacement.</p>