code: def _stack(
      in_ch: int,
      out_ch: int,
      kernel_size: int,
      stride: int,
      exp_factor: int,
      repeats: int,
      bn_momentum: float,
  ) -> nn.Sequential:
      """Creates a stack of inverted residuals."""
      if repeats < 1:
          raise ValueError(
              f"repeats should be >= 1, instead got {repeats}"
          )
      # First one has no skip, because feature map size changes.
      first = _InvertedResidual(
          in_ch,
          out_ch,
          kernel_size,
          stride,
          exp_factor,
          bn_momentum=bn_momentum,
      )
      remaining = []
      for _ in range(1, repeats):
          remaining.append(
              _InvertedResidual(
                  out_ch,
                  out_ch,
                  kernel_size,
                  1,
                  exp_factor,
                  bn_momentum=bn_momentum,
              )
          )
      return nn.Sequential(first, *remaining)
  
imports: import warnings
  from functools import partial
  from typing import Any, Dict, List, Optional
  import torch
  import torch.nn
  from torch import Tensor
  from ..transforms._presets import ImageClassification
  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 1 for calling a global function with example usage: _stack(in_ch, out_ch, kernel_size, stride, exp_factor, repeats, bn_momentum) and returns: nn