src/transformers/models/donut/modeling_donut_swin.py/DonutSwinLayer/set_shift_and_window_size
class DonutSwinLayer:    def set_shift_and_window_size(self, input_resolution):
        if min(input_resolution) <= self.window_size:
            # if window size is larger than input resolution, we don't partition windows
            self.shift_size = 0
            self.window_size = min(input_resolution)