Guest User

Untitled

a guest
Jul 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. my_input = ... # for example a 1x3x6x1 tensor similar to your example
  2. tile_size = [1, 3, 3, 1]
  3. r = tf.random_uniform(my_input.shape)
  4. maxr, idxs = tf.nn.max_pool_with_argmax(r, tile_size, tile_size, 'SAME')
  5. rand_samp_per_tile = tf.reshape(tf.gather(tf.reshape(my_input, [-1]), idxs), maxr.shape)
Add Comment
Please, Sign In to add comment