docstr: BasicBlock layer of DarkNet
  
  Args:
      ch_in (int): input channel
      ch_out (int): output channel
      norm_type (str): batch norm type, default bn
      norm_decay (str): decay for weight and bias of batch norm layer, default 0.
      freeze_norm (bool): whether to freeze norm, default False
      data_format (str): data format, NCHW or NHWC
docstr_tok: ["BasicBlock","layer","of","DarkNet","Args",":","ch_in","(","int",")",":","input","channel","ch_out","(","int",")",":","output","channel","norm_type","(","str",")",":","batch","norm","type",",","default","bn","norm_decay","(","str",")",":","decay","for","weight","and","bias","of","batch","norm","layer",",","default","0.","freeze_norm","(","bool",")",":","whether","to","freeze","norm",",","default","False","data_format","(","str",")",":","data","format",",","NCHW","or","NHWC"]
code: def __init__(
      self,
      ch_in,
      ch_out,
      norm_type="bn",
      norm_decay=0.0,
      freeze_norm=False,
      data_format="NCHW",
  ):
      """
      BasicBlock layer of DarkNet
  
      Args:
          ch_in (int): input channel
          ch_out (int): output channel
          norm_type (str): batch norm type, default bn
          norm_decay (str): decay for weight and bias of batch norm layer, default 0.
          freeze_norm (bool): whether to freeze norm, default False
          data_format (str): data format, NCHW or NHWC
      """
  
      super(BasicBlock, self).__init__()
  
      assert (
          ch_in == ch_out and (ch_in % 2) == 0
      ), f"ch_in and ch_out should be the same even int, but the input 'ch_in is {ch_in}, 'ch_out is {ch_out}"
      # example:
      # --------------{conv1} --> {conv2}
      # channel route: 10-->5 --> 5-->10
      self.conv1 = ConvBNLayer(
          ch_in=ch_in,
          ch_out=int(ch_out / 2),
          filter_size=1,
          stride=1,
          padding=0,
          norm_type=norm_type,
          norm_decay=norm_decay,
          freeze_norm=freeze_norm,
          data_format=data_format,
      )
      self.conv2 = ConvBNLayer(
          ch_in=int(ch_out / 2),
          ch_out=ch_out,
          filter_size=3,
          stride=1,
          padding=1,
          norm_type=norm_type,
          norm_decay=norm_decay,
          freeze_norm=freeze_norm,
          data_format=data_format,
      )
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register, serializable
  from ppdet.modeling.ops import batch_norm, mish
  from ..shape_spec import ShapeSpec
label_desc: Use image node_id 1 to create a new BasicBlock object from inherited base classes: nn with example: obj = BasicBlock(ch_in, ch_out, norm_type, norm_decay, freeze_norm, data_format)