code: def __init__(self, config):
      super(TextGenerator, self).__init__()
      name = config["module_name"]
      encode_dim = config["encode_dim"]
      norm_layer = config["norm_layer"]
      conv_block_dropout = config["conv_block_dropout"]
      conv_block_num = config["conv_block_num"]
      conv_block_dilation = config["conv_block_dilation"]
      if norm_layer == "InstanceNorm2D":
          use_bias = True
      else:
          use_bias = False
      self.encoder_text = Encoder(
          name=name + "_encoder_text",
          in_channels=3,
          encode_dim=encode_dim,
          use_bias=use_bias,
          norm_layer=norm_layer,
          act="ReLU",
          act_attr=None,
          conv_block_dropout=conv_block_dropout,
          conv_block_num=conv_block_num,
          conv_block_dilation=conv_block_dilation,
      )
      self.encoder_style = Encoder(
          name=name + "_encoder_style",
          in_channels=3,
          encode_dim=encode_dim,
          use_bias=use_bias,
          norm_layer=norm_layer,
          act="ReLU",
          act_attr=None,
          conv_block_dropout=conv_block_dropout,
          conv_block_num=conv_block_num,
          conv_block_dilation=conv_block_dilation,
      )
      self.decoder_text = Decoder(
          name=name + "_decoder_text",
          encode_dim=encode_dim,
          out_channels=int(encode_dim / 2),
          use_bias=use_bias,
          norm_layer=norm_layer,
          act="ReLU",
          act_attr=None,
          conv_block_dropout=conv_block_dropout,
          conv_block_num=conv_block_num,
          conv_block_dilation=conv_block_dilation,
          out_conv_act="Tanh",
          out_conv_act_attr=None,
      )
      self.decoder_sk = Decoder(
          name=name + "_decoder_sk",
          encode_dim=encode_dim,
          out_channels=1,
          use_bias=use_bias,
          norm_layer=norm_layer,
          act="ReLU",
          act_attr=None,
          conv_block_dropout=conv_block_dropout,
          conv_block_num=conv_block_num,
          conv_block_dilation=conv_block_dilation,
          out_conv_act="Sigmoid",
          out_conv_act_attr=None,
      )
  
      self.middle = MiddleNet(
          name=name + "_middle_net",
          in_channels=int(encode_dim / 2) + 1,
          mid_channels=encode_dim,
          out_channels=3,
          use_bias=use_bias,
      )
  
imports: import paddle
  import paddle.nn
  from arch.base_module import MiddleNet, ResBlock
  from arch.encoder import Encoder
  from arch.decoder import Decoder, DecoderUnet, SingleDecoder
  from utils.load_params import load_dygraph_pretrain
  from utils.logging import get_logger
label_desc: Use image node_id 1 to create a new TextGenerator object from inherited base classes: nn with example: obj = TextGenerator(config)