class_docstr: The template for a conv-bn-relu block.
class_docstr_tok: ["The","template","for","a","conv-bn-relu","block","."]
code: def __init__(
      self,
      in_channels: MaybeIntChoice,
      out_channels: MaybeIntChoice,
      kernel_size: MaybeIntChoice = 3,
      stride: int = 1,
      groups: MaybeIntChoice = 1,
      norm_layer: Optional[Callable[[int], nn.Module]] = None,
      activation_layer: Optional[Callable[..., nn.Module]] = None,
      dilation: int = 1,
  ) -> None:
      padding = (kernel_size - 1) // 2 * dilation
      if norm_layer is None:
          norm_layer = MutableBatchNorm2d
      if activation_layer is None:
          activation_layer = nn.ReLU6
      # If no normalization is used, set bias to True
      # https://github.com/google-research/google-research/blob/20736344/tunas/rematlib/mobile_model_v3.py#L194
      norm = norm_layer(cast(int, out_channels))
      no_normalization = isinstance(norm, nn.Identity)
      blocks: List[nn.Module] = [
          MutableConv2d(
              cast(int, in_channels),
              cast(int, out_channels),
              cast(int, kernel_size),
              stride,
              cast(int, padding),
              dilation=dilation,
              groups=cast(int, groups),
              bias=no_normalization,
          ),
          # Normalization, regardless of batchnorm or identity
          norm,
          # One pytorch implementation as an SE here, to faithfully reproduce paper
          # We follow a more accepted approach to put SE outside
          # Reference: https://github.com/d-li14/mobilenetv3.pytorch/issues/18
          activation_layer(inplace=True),
      ]
  
      super().__init__(*simplify_sequential(blocks))
  
imports: import math
  from typing import Optional, Callable, List, Tuple, Iterator, Union, cast, overload
  import torch
  from torch import nn
  from nni.mutable import MutableExpression
  from nni.nas.nn.pytorch import ModelSpace, LayerChoice, Repeat, MutableConv2d, MutableLinear, MutableBatchNorm2d
  from .utils.pretrained import load_pretrained_weight
label_desc: Use image node_id 1 to create a new ConvBNReLU object from inherited base classes: nn with example: obj = ConvBNReLU(in_channels, out_channels, kernel_size, stride, groups, norm_layer, activation_layer, dilation)