code: def __init__(
      self, in_channels, encoder_type, hidden_size=48, **kwargs
  ):
      super(SequenceEncoder, self).__init__()
      self.encoder_reshape = Im2Seq(in_channels)
      self.out_channels = self.encoder_reshape.out_channels
      self.encoder_type = encoder_type
      if encoder_type == "reshape":
          self.only_reshape = True
      else:
          support_encoder_dict = {
              "reshape": Im2Seq,
              "fc": EncoderWithFC,
              "rnn": EncoderWithRNN,
              "svtr": EncoderWithSVTR,
              "cascadernn": EncoderWithCascadeRNN,
          }
          assert (
              encoder_type in support_encoder_dict
          ), "{} must in {}".format(
              encoder_type, support_encoder_dict.keys()
          )
          if encoder_type == "svtr":
              self.encoder = support_encoder_dict[encoder_type](
                  self.encoder_reshape.out_channels, **kwargs
              )
          elif encoder_type == "cascadernn":
              self.encoder = support_encoder_dict[encoder_type](
                  self.encoder_reshape.out_channels,
                  hidden_size,
                  **kwargs,
              )
          else:
              self.encoder = support_encoder_dict[encoder_type](
                  self.encoder_reshape.out_channels, hidden_size
              )
          self.out_channels = self.encoder.out_channels
          self.only_reshape = False
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  from paddle import nn
  from ppocr.modeling.heads.rec_ctc_head import get_para_bias_attr
  from ppocr.modeling.backbones.rec_svtrnet import Block, ConvBNLayer, trunc_normal_, zeros_, ones_
label_desc: Use image node_id 1 to create a new SequenceEncoder object from inherited base classes: nn with example: obj = SequenceEncoder(in_channels, encoder_type, hidden_size)