class_docstr: See :func:`shifted_window_attention_v2`.
class_docstr_tok: ["See",":","func",":","`","shifted_window_attention_v2","`","."]
code: def get_relative_position_bias(self) -> torch.Tensor:
      relative_position_bias = _get_relative_position_bias(
          self.cpb_mlp(self.relative_coords_table).view(
              -1, self.num_heads
          ),
          self.relative_position_index,  # type: ignore[arg-type]
          self.window_size,
      )
      relative_position_bias = 16 * torch.sigmoid(
          relative_position_bias
      )
      return relative_position_bias
  
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 3 for calling the ShiftedWindowAttentionV2 obj's underlying member method code with example usage: obj.get_relative_position_bias() and returns: relative_position_bias