Categories
Misc

Most computational efficient way for list of random numbers in Tensroflow given a list of maxiumum values like in `np.random.randint`

For np.random.randint, you can input a list of maximum values, and get a list of random ints from 0 to those maximum values.

np.random.randint([1, 10, 100, 1000] ) >array([ 0, 7, 31, 348]) 

Tensorflow tf.random.uniform doesn’t allow lists for maxval, so you need to either create a statement for each, or run a loop. I was wondering if there was more elegant way to get these random numbers.

submitted by /u/PrudentAlternative10
[visit reddit] [comments]

Leave a Reply

Your email address will not be published.