class_docstr: Swin Transformer Block.
      
code: def _calc_window_shift(
      self,
      target_window_size: _int_or_tuple_2_t,
      target_shift_size: _int_or_tuple_2_t,
  ) -> Tuple[Tuple[int, int], Tuple[int, int]]:
      target_window_size = to_2tuple(target_window_size)
      target_shift_size = to_2tuple(target_shift_size)
      window_size = [
          r if r <= w else w
          for r, w in zip(self.input_resolution, target_window_size)
      ]
      shift_size = [
          0 if r <= w else s
          for r, w, s in zip(
              self.input_resolution, window_size, target_shift_size
          )
      ]
      return tuple(window_size), tuple(shift_size)
  
imports: import math
  from typing import Callable, Optional, Tuple, Union, Set, Dict
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.utils.checkpoint
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
  from timm.layers import PatchEmbed, Mlp, DropPath, to_2tuple, trunc_normal_, _assert, ClassifierHead, resample_patch_embed
  from ._builder import build_model_with_cfg
  from ._features_fx import register_notrace_function
  from ._registry import generate_default_cfgs, register_model, register_model_deprecations
label_desc: Use image node_id 2 for calling the SwinTransformerV2Block obj's underlying member method code with example usage: obj._calc_window_shift(target_window_size, target_shift_size) and returns: tuple,  tuple