class_docstr: Describe the basic building block of shuffle net, as described in
  `ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices <https://arxiv.org/pdf/1707.01083.pdf>`__.
  
  When stride = 1, the block expects an input with ``2 * input channels``. Otherwise input channels.
code: def __init__(
      self,
      in_channels: int,
      out_channels: int,
      mid_channels: Union[int, MutableExpression[int]],
      *,
      kernel_size: int,
      stride: int,
      sequence: str = "pdp",
      affine: bool = True,
  ):
      super().__init__()
      assert stride in [1, 2]
      assert kernel_size in [3, 5, 7]
      self.channels = in_channels // 2 if stride == 1 else in_channels
      self.in_channels = in_channels
      self.out_channels = out_channels
      self.mid_channels = mid_channels
      self.kernel_size = kernel_size
      self.stride = stride
      self.pad = kernel_size // 2
      self.oup_main = out_channels - self.channels
      self.affine = affine
      assert self.oup_main > 0
  
      self.branch_main = nn.Sequential(
          *self._decode_point_depth_conv(sequence)
      )
  
      if stride == 2:
          self.branch_proj = nn.Sequential(
              # dw
              MutableConv2d(
                  self.channels,
                  self.channels,
                  kernel_size,
                  stride,
                  self.pad,
                  groups=self.channels,
                  bias=False,
              ),
              MutableBatchNorm2d(self.channels, affine=affine),
              # pw-linear
              MutableConv2d(
                  self.channels, self.channels, 1, 1, 0, bias=False
              ),
              MutableBatchNorm2d(self.channels, affine=affine),
              nn.ReLU(inplace=True),
          )
      else:
          # empty block to be compatible with torchscript
          self.branch_proj = nn.Sequential()
  
imports: from typing import Union, cast
  import torch
  import torch.nn
  import nni
  from nni.mutable import MutableExpression
  from nni.nas.nn.pytorch import LayerChoice, ModelSpace, MutableConv2d, MutableBatchNorm2d
  from .utils.pretrained import load_pretrained_weight
label_desc: Use image node_id 1 to create a new ShuffleNetBlock object from inherited base classes: nn with example: obj = ShuffleNetBlock(in_channels, out_channels, mid_channels)