class_docstr: The Encoder implementation of FC-HardDNet 70.
  
  Args:
      n_blocks (int): The number of blocks in the Encoder module.
      in_channels (int): The number of input channels.
      ch_list (tuple|list): The number of channels at each block in the encoder.
      grmul (float): The channel multiplying factor in HarDBlock, which is m in the paper.
      gr (tuple|list): The growth rate in each HarDBlock, which is k in the paper.
      n_layers (tuple|list): The number of layers in each HarDBlock.
class_docstr_tok: ["The","Encoder","implementation","of","FC-HardDNet","70",".","Args",":","n_blocks","(","int",")",":","The","number","of","blocks","in","the","Encoder","module",".","in_channels","(","int",")",":","The","number","of","input","channels",".","ch_list","(","tuple|list",")",":","The","number","of","channels","at","each","block","in","the","encoder",".","grmul","(","float",")",":","The","channel","multiplying","factor","in","HarDBlock",",","which","is","m","in","the","paper",".","gr","(","tuple|list",")",":","The","growth","rate","in","each","HarDBlock",",","which","is","k","in","the","paper",".","n_layers","(","tuple|list",")",":","The","number","of","layers","in","each","HarDBlock","."]
code: def __init__(
      self,
      n_blocks: int,
      in_channels: int,
      ch_list: List[int],
      gr: List[int],
      grmul: float,
      n_layers: List[int],
  ):
      super().__init__()
      self.skip_connection_channels = []
      self.shortcut_layers = []
      self.blks = nn.LayerList()
      ch = in_channels
      for i in range(n_blocks):
          blk = HarDBlock(ch, gr[i], grmul, n_layers[i])
          ch = blk.get_out_ch()
          self.skip_connection_channels.append(ch)
          self.blks.append(blk)
          if i < n_blocks - 1:
              self.shortcut_layers.append(len(self.blks) - 1)
          self.blks.append(
              layers.ConvBNReLU(
                  ch, ch_list[i], kernel_size=1, bias_attr=False
              )
          )
  
          ch = ch_list[i]
          if i < n_blocks - 1:
              self.blks.append(nn.AvgPool2D(kernel_size=2, stride=2))
      self.out_channels = ch
  
imports: import os
  from typing import Union, Tuple, List
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddlehub.module.module import moduleinfo
  import paddlehub.vision.segmentation_transforms
  from paddlehub.module.cv_module import ImageSegmentationModule
  import hardnet_cityscapes.layers
label_desc: Use image node_id 1 to create a new Encoder object from inherited base classes: nn with example: obj = Encoder(n_blocks, in_channels, ch_list, gr, grmul, n_layers)