class_docstr: MSGNet (from MSG-Net paper)
  Enables passing identity all the way through the generator
  ref https://arxiv.org/abs/1703.06953
  
  Args:
     input_nc(int): Number of input channels, default is 3.
     output_nc(int): Number of output channels, default is 3.
     ngf(int): Number of input channel for middle layer, default is 128.
     n_blocks(int): Block number, default is 6.
     norm_layer(nn.Layer): Batch norm layer, default is nn.InstanceNorm2D.
     load_checkpoint(str): Pretrained checkpoint path, default is None.
  
  Return:
      img(paddle.Tensor): MSGNet output.
class_docstr_tok: ["MSGNet","(","from","MSG-Net","paper",")","Enables","passing","identity","all","the","way","through","the","generator","ref","https",":","\/\/arxiv.org\/abs\/1703.06953","Args",":","input_nc","(","int",")",":","Number","of","input","channels",",","default","is","3.","output_nc","(","int",")",":","Number","of","output","channels",",","default","is","3.","ngf","(","int",")",":","Number","of","input","channel","for","middle","layer",",","default","is","128.","n_blocks","(","int",")",":","Block","number",",","default","is","6.","norm_layer","(","nn.Layer",")",":","Batch","norm","layer",",","default","is","nn.InstanceNorm2D",".","load_checkpoint","(","str",")",":","Pretrained","checkpoint","path",",","default","is","None",".","Return",":","img","(","paddle.Tensor",")",":","MSGNet","output","."]
code: def __init__(
      self,
      input_nc=3,
      output_nc=3,
      ngf=128,
      n_blocks=6,
      norm_layer=nn.InstanceNorm2D,
      load_checkpoint=None,
  ):
      super(MSGNet, self).__init__()
      self.gram = GramMatrix()
      block = Bottleneck
      upblock = UpBottleneck
      expansion = 4
  
      model1 = [
          ConvLayer(input_nc, 64, kernel_size=7, stride=1),
          norm_layer(64),
          nn.ReLU(),
          block(64, 32, 2, 1, norm_layer),
          block(32 * expansion, ngf, 2, 1, norm_layer),
      ]
  
      self.model1 = nn.Sequential(*tuple(model1))
  
      model = []
      model += model1
  
      self.ins = Inspiration(ngf * expansion)
      model.append(self.ins)
      for i in range(n_blocks):
          model += [block(ngf * expansion, ngf, 1, None, norm_layer)]
  
      model += [
          upblock(ngf * expansion, 32, 2, norm_layer),
          upblock(32 * expansion, 16, 2, norm_layer),
          norm_layer(16 * expansion),
          nn.ReLU(),
          ConvLayer(16 * expansion, output_nc, kernel_size=7, stride=1),
      ]
      model = tuple(model)
      self.model = nn.Sequential(*model)
  
      if load_checkpoint is not None:
          self.model_dict = paddle.load(load_checkpoint)
          self.set_dict(self.model_dict)
          print("load custom checkpoint success")
  
      else:
          checkpoint = os.path.join(
              self.directory, "style_paddle.pdparams"
          )
          model_dict = paddle.load(checkpoint)
          model_dict_clone = model_dict.copy()
          for key, value in model_dict_clone.items():
              if key.endswith(("scale")):
                  name = key.rsplit(".", 1)[0] + ".bias"
                  model_dict[name] = paddle.zeros(
                      shape=model_dict[name].shape, dtype="float32"
                  )
                  model_dict[key] = paddle.ones(
                      shape=model_dict[key].shape, dtype="float32"
                  )
          self.set_dict(model_dict)
          self.model_dict = model_dict
          print("load pretrained checkpoint success")
  
      self._vgg = None
  
imports: import os
  import argparse
  import paddle
  import paddle.nn
  import numpy
  import paddle.nn.functional
  from paddlehub.env import MODULE_HOME
  from paddlehub.module.module import moduleinfo
  from paddlehub.vision.transforms import Compose, Resize, CenterCrop
  from paddlehub.module.cv_module import StyleTransferModule
label_desc: Use image node_id 1 to create a new MSGNet object from inherited base classes: nn with example: obj = MSGNet(input_nc, output_nc, ngf, n_blocks, norm_layer, load_checkpoint)