Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my_input = ... # for example a 1x3x6x1 tensor similar to your example
- tile_size = [1, 3, 3, 1]
- r = tf.random_uniform(my_input.shape)
- maxr, idxs = tf.nn.max_pool_with_argmax(r, tile_size, tile_size, 'SAME')
- rand_samp_per_tile = tf.reshape(tf.gather(tf.reshape(my_input, [-1]), idxs), maxr.shape)
Add Comment
Please, Sign In to add comment