code: def swin_b(
      *,
      weights: Optional[Swin_B_Weights] = None,
      progress: bool = True,
      **kwargs: Any,
  ) -> SwinTransformer:
      """
      Constructs a swin_base architecture from
      `Swin Transformer: Hierarchical Vision Transformer using Shifted Windows <https://arxiv.org/abs/2103.14030>`_.
  
      Args:
          weights (:class:`~torchvision.models.Swin_B_Weights`, optional): The
              pretrained weights to use. See
              :class:`~torchvision.models.Swin_B_Weights` below for
              more details, and possible values. By default, no pre-trained
              weights are used.
          progress (bool, optional): If True, displays a progress bar of the
              download to stderr. Default is True.
          **kwargs: parameters passed to the ``torchvision.models.swin_transformer.SwinTransformer``
              base class. Please refer to the `source code
              <https://github.com/pytorch/vision/blob/main/torchvision/models/swin_transformer.py>`_
              for more details about this class.
  
      .. autoclass:: torchvision.models.Swin_B_Weights
          :members:
      """
      weights = Swin_B_Weights.verify(weights)
  
      return _swin_transformer(
          patch_size=[4, 4],
          embed_dim=128,
          depths=[2, 2, 18, 2],
          num_heads=[4, 8, 16, 32],
          window_size=[7, 7],
          stochastic_depth_prob=0.5,
          weights=weights,
          progress=progress,
          **kwargs,
      )
  
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 7 for calling a global function with example usage: swin_b() and returns: _swin_transformer