h_shift, w_shift = h * pool_h + max_idx[0], w * pool_w + max_idx[1]