class_docstr: See :func:`shifted_window_attention`.
class_docstr_tok: ["See",":","func",":","`","shifted_window_attention","`","."]
code: def define_relative_position_bias_table(self):
      # define a parameter table of relative position bias
      self.relative_position_bias_table = nn.Parameter(
          torch.zeros(
              (2 * self.window_size[0] - 1)
              * (2 * self.window_size[1] - 1),
              self.num_heads,
          )
      )  # 2*Wh-1 * 2*Ww-1, nH
      nn.init.trunc_normal_(self.relative_position_bias_table, std=0.02)
  
imports: import math
  from functools import partial
  from typing import Any, Callable, List, Optional
  import torch
  import torch.nn.functional
  from torch import nn, Tensor
  from ..ops.misc import MLP, Permute
  from ..ops.stochastic_depth import StochasticDepth
  from ..transforms._presets import ImageClassification, InterpolationMode
  from ..utils import _log_api_usage_once
  from ._api import register_model, Weights, WeightsEnum
  from ._meta import _IMAGENET_CATEGORIES
  from ._utils import _ovewrite_named_param, handle_legacy_interface
label_desc: Use image node_id 2 for calling the ShiftedWindowAttention obj's underlying member method code with example usage: obj.define_relative_position_bias_table() without return types