import tensorflow as tf

        strides)
    h_scale = strides[1]
    w_scale = strides[2]
    scale = tf.stack([1, h_scale, w_scale])
    indices *= scale
    # Since we always use VALID to perform pooling, shift is needed here.
    shift = tf.stack([0, (ksize[1] - 1) // 2, (ksize[2] - 1) // 2])
    indices += shift
    indices_ = tf.expand_dims(tf.expand_dims(indices, 1), 2)
    # indices_ = tf.tile(indices_, [1, ksize[1], ksize[2], 1])
    offset = _get_offset_array(ksize[0:3])
    indices_ += offset
