code: def sample_fixed_offset(
      image_w: int,
      image_h: int,
      crop_w: int,
      crop_h: int,
      more_fix_crop: bool = True,
  ) -> tf.Tensor:
      """Sample offset of the crop out of 13 fixed offsets.
  
      The sampling strategy is taken from: https://arxiv.org/abs/2203.12602, Github:
      https://github.com/MCG-NJU/VideoMAE.
  
      Args:
        image_w: The width of the image.
        image_h: The height of the image.
        crop_w: The width of the crop.
        crop_h: The height of the crop.
        more_fix_crop: Add another 8 fixed crops to the sampling.
  
      Returns:
        A tensor of shape [1, 2] with the corresponding offset
        [[offset_w, offset_h]].
      """
      w_step = (image_w - crop_w) // 4
      h_step = (image_h - crop_h) // 4
  
      ret = list()
      ret.append((tf.constant(0), tf.constant(0)))  # upper left
      ret.append((4 * w_step, 0))  # upper right
      ret.append((0, 4 * h_step))  # lower left
      ret.append((4 * w_step, 4 * h_step))  # lower right
      ret.append((2 * w_step, 2 * h_step))  # center
  
      if more_fix_crop:
          ret.append((0, 2 * h_step))  # center left
          ret.append((4 * w_step, 2 * h_step))  # center right
          ret.append((2 * w_step, 4 * h_step))  # lower center
          ret.append((2 * w_step, 0 * h_step))  # upper center
  
          ret.append((1 * w_step, 1 * h_step))  # upper left quarter
          ret.append((3 * w_step, 1 * h_step))  # upper right quarter
          ret.append((1 * w_step, 3 * h_step))  # lower left quarter
          ret.append((3 * w_step, 3 * h_step))  # lower right quarter
  
      ret_index = tf.random.uniform(
          (1, 1), minval=0, maxval=len(ret), dtype=tf.int32
      )[0, 0]
      ret = tf.stack(ret)
  
      ret_pair = tf.slice(ret, [ret_index, 0], [1, 2])
      return ret_pair
  
imports: from typing import Optional, Union
  from absl import logging
  from dmvr import builders
  from dmvr import processors
  import ml_collections
  import tensorflow
label_desc: Use image node_id 12 for calling a global function with example usage: sample_fixed_offset(image_w, image_h, crop_w, crop_h, more_fix_crop) and returns: ret_pair