def METHOD_NAME(self):
    # random_interval = 10 as default, every 10 iters to change self._input_size
    image_ratio = self.input_size[1] * 1.0 / self.input_size[0]
    if self._step % self.random_interval == 0:
        size_factor = random.randint(*self.size_range)
        size = [
            self.size_stride * size_factor,
            self.size_stride * int(size_factor * image_ratio)
        ]
        self._input_size = paddle.to_tensor(size)
    self._step += 1