code: def _swin_transformer3d(
      patch_size: List[int],
      embed_dim: int,
      depths: List[int],
      num_heads: List[int],
      window_size: List[int],
      stochastic_depth_prob: float,
      weights: Optional[WeightsEnum],
      progress: bool,
      **kwargs: Any,
  ) -> SwinTransformer3d:
      if weights is not None:
          _ovewrite_named_param(
              kwargs, "num_classes", len(weights.meta["categories"])
          )
  
      model = SwinTransformer3d(
          patch_size=patch_size,
          embed_dim=embed_dim,
          depths=depths,
          num_heads=num_heads,
          window_size=window_size,
          stochastic_depth_prob=stochastic_depth_prob,
          **kwargs,
      )
  
      if weights is not None:
          model.load_state_dict(
              weights.get_state_dict(progress=progress, check_hash=True)
          )
  
      return model
  
imports: from functools import partial
  from typing import Any, Callable, List, Optional, Tuple
  import torch
  import torch.nn.functional
  from torch import nn, Tensor
  from ...transforms._presets import VideoClassification
  from ...utils import _log_api_usage_once
  from .._api import register_model, Weights, WeightsEnum
  from .._meta import _KINETICS400_CATEGORIES
  from .._utils import _ovewrite_named_param, handle_legacy_interface
  from ..swin_transformer import PatchMerging, SwinTransformerBlock
label_desc: Use image node_id 6 for calling a global function with example usage: _swin_transformer3d(patch_size, embed_dim, depths, num_heads, window_size, stochastic_depth_prob, weights, progress) and returns: model