code: def __init__(
      self,
      in_channels,
      out_channels1,
      out_channels2,
      double_channels=None,
      stride=1,
      use_5x5kernel=True,
      act="relu",
      name=None,
  ):
      super(BlazeBlock, self).__init__()
      assert stride in [1, 2]
      self.use_pool = not stride == 1
      self.use_double_block = double_channels is not None
      self.conv_dw = []
      if use_5x5kernel:
          self.conv_dw.append(
              self.add_sublayer(
                  name + "1_dw",
                  ConvBNLayer(
                      in_channels=in_channels,
                      out_channels=out_channels1,
                      kernel_size=5,
                      stride=stride,
                      padding=2,
                      num_groups=out_channels1,
                      name=name + "1_dw",
                  ),
              )
          )
      else:
          self.conv_dw.append(
              self.add_sublayer(
                  name + "1_dw_1",
                  ConvBNLayer(
                      in_channels=in_channels,
                      out_channels=out_channels1,
                      kernel_size=3,
                      stride=1,
                      padding=1,
                      num_groups=out_channels1,
                      name=name + "1_dw_1",
                  ),
              )
          )
          self.conv_dw.append(
              self.add_sublayer(
                  name + "1_dw_2",
                  ConvBNLayer(
                      in_channels=out_channels1,
                      out_channels=out_channels1,
                      kernel_size=3,
                      stride=stride,
                      padding=1,
                      num_groups=out_channels1,
                      name=name + "1_dw_2",
                  ),
              )
          )
      self.act = act if self.use_double_block else None
      self.conv_pw = ConvBNLayer(
          in_channels=out_channels1,
          out_channels=out_channels2,
          kernel_size=1,
          stride=1,
          padding=0,
          act=self.act,
          name=name + "1_sep",
      )
      if self.use_double_block:
          self.conv_dw2 = []
          if use_5x5kernel:
              self.conv_dw2.append(
                  self.add_sublayer(
                      name + "2_dw",
                      ConvBNLayer(
                          in_channels=out_channels2,
                          out_channels=out_channels2,
                          kernel_size=5,
                          stride=1,
                          padding=2,
                          num_groups=out_channels2,
                          name=name + "2_dw",
                      ),
                  )
              )
          else:
              self.conv_dw2.append(
                  self.add_sublayer(
                      name + "2_dw_1",
                      ConvBNLayer(
                          in_channels=out_channels2,
                          out_channels=out_channels2,
                          kernel_size=3,
                          stride=1,
                          padding=1,
                          num_groups=out_channels2,
                          name=name + "1_dw_1",
                      ),
                  )
              )
              self.conv_dw2.append(
                  self.add_sublayer(
                      name + "2_dw_2",
                      ConvBNLayer(
                          in_channels=out_channels2,
                          out_channels=out_channels2,
                          kernel_size=3,
                          stride=1,
                          padding=1,
                          num_groups=out_channels2,
                          name=name + "2_dw_2",
                      ),
                  )
              )
          self.conv_pw2 = ConvBNLayer(
              in_channels=out_channels2,
              out_channels=double_channels,
              kernel_size=1,
              stride=1,
              padding=0,
              name=name + "2_sep",
          )
      # shortcut
      if self.use_pool:
          shortcut_channel = double_channels or out_channels2
          self._shortcut = []
          self._shortcut.append(
              self.add_sublayer(
                  name + "_shortcut_pool",
                  nn.MaxPool2D(
                      kernel_size=stride, stride=stride, ceil_mode=True
                  ),
              )
          )
          self._shortcut.append(
              self.add_sublayer(
                  name + "_shortcut_conv",
                  ConvBNLayer(
                      in_channels=in_channels,
                      out_channels=shortcut_channel,
                      kernel_size=1,
                      stride=1,
                      padding=0,
                      name="shortcut" + name,
                  ),
              )
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle import ParamAttr
  from paddle.nn.initializer import KaimingNormal
  from ppdet.core.workspace import register, serializable
  from ..shape_spec import ShapeSpec
label_desc: Use image node_id 1 to create a new BlazeBlock object from inherited base classes: nn with example: obj = BlazeBlock(in_channels, out_channels1, out_channels2, double_channels, stride, use_5x5kernel, act, name)