class_docstr: EfficientNet backbone.
  
  Args:
      arch (str): Architecture of efficientnet. Defaults to b0.
      out_indices (Sequence[int]): Output from which stages.
          Defaults to (6, ).
      frozen_stages (int): Stages to be frozen (all param fixed).
          Defaults to 0, which means not freezing any parameters.
      conv_cfg (dict): Config dict for convolution layer.
          Defaults to None, which means using conv2d.
      norm_cfg (dict): Config dict for normalization layer.
          Defaults to dict(type='BN').
      act_cfg (dict): Config dict for activation layer.
          Defaults to dict(type='Swish').
      norm_eval (bool): Whether to set norm layers to eval mode, namely,
          freeze running stats (mean and var). Note: Effect on Batch Norm
          and its variants only. Defaults to False.
      with_cp (bool): Use checkpoint or not. Using checkpoint will save some
          memory while slowing down the training speed. Defaults to False.
code: def make_layer(self):
      # Without the first and the final conv block.
      layer_setting = self.layer_setting[1:-1]
  
      total_num_blocks = sum([len(x) for x in layer_setting])
      block_idx = 0
      dpr = [
          x.item()
          for x in torch.linspace(
              0, self.drop_path_rate, total_num_blocks
          )
      ]  # stochastic depth decay rule
  
      for i, layer_cfg in enumerate(layer_setting):
          # Avoid building unused layers in mmdetection.
          if i > max(self.out_indices) - 1:
              break
          layer = []
          for i, block_cfg in enumerate(layer_cfg):
              (
                  kernel_size,
                  out_channels,
                  se_ratio,
                  stride,
                  expand_ratio,
                  block_type,
              ) = block_cfg
  
              mid_channels = int(self.in_channels * expand_ratio)
              out_channels = make_divisible(out_channels, 8)
              if se_ratio <= 0:
                  se_cfg = None
              else:
                  # In mmdetection, the `divisor` is deleted to align
                  # the logic of SELayer with mmpretrain.
                  se_cfg = dict(
                      channels=mid_channels,
                      ratio=expand_ratio * se_ratio,
                      act_cfg=(self.act_cfg, dict(type="Sigmoid")),
                  )
              if block_type == 1:  # edge tpu
                  if i > 0 and expand_ratio == 3:
                      with_residual = False
                      expand_ratio = 4
                  else:
                      with_residual = True
                  mid_channels = int(self.in_channels * expand_ratio)
                  if se_cfg is not None:
                      # In mmdetection, the `divisor` is deleted to align
                      # the logic of SELayer with mmpretrain.
                      se_cfg = dict(
                          channels=mid_channels,
                          ratio=se_ratio * expand_ratio,
                          act_cfg=(self.act_cfg, dict(type="Sigmoid")),
                      )
                  block = partial(
                      EdgeResidual, with_residual=with_residual
                  )
              else:
                  block = InvertedResidual
              layer.append(
                  block(
                      in_channels=self.in_channels,
                      out_channels=out_channels,
                      mid_channels=mid_channels,
                      kernel_size=kernel_size,
                      stride=stride,
                      se_cfg=se_cfg,
                      conv_cfg=self.conv_cfg,
                      norm_cfg=self.norm_cfg,
                      act_cfg=self.act_cfg,
                      drop_path_rate=dpr[block_idx],
                      with_cp=self.with_cp,
                      # In mmdetection, `with_expand_conv` is set to align
                      # the logic of InvertedResidual with mmpretrain.
                      with_expand_conv=(
                          mid_channels != self.in_channels
                      ),
                  )
              )
              self.in_channels = out_channels
              block_idx += 1
          self.layers.append(Sequential(*layer))
  
imports: import copy
  import math
  from functools import partial
  import torch
  import torch.nn
  import torch.utils.checkpoint
  from mmcv.cnn.bricks import ConvModule, DropPath
  from mmengine.model import BaseModule, Sequential
  from mmdet.registry import MODELS
  from ..layers import InvertedResidual, SELayer
  from ..utils import make_divisible
label_desc: Use image node_id 2 for calling the EfficientNet obj's underlying member method code with example usage: obj.make_layer() without return types