code: def __init__(
      self,
      input_nc,
      output_nc,
      ngf=64,
      n_downsampling=3,
      n_blocks=9,
      norm_layer=nn.BatchNorm2d,
      padding_type="reflect",
      last_op=nn.Tanh(),
  ):
      assert n_blocks >= 0
      super(GlobalGenerator, self).__init__()
      activation = nn.ReLU(True)
  
      model = [
          nn.ReflectionPad2d(3),
          nn.Conv2d(input_nc, ngf, kernel_size=7, padding=0),
          norm_layer(ngf),
          activation,
      ]
      ### downsample
      for i in range(n_downsampling):
          mult = 2**i
          model += [
              nn.Conv2d(
                  ngf * mult,
                  ngf * mult * 2,
                  kernel_size=3,
                  stride=2,
                  padding=1,
              ),
              norm_layer(ngf * mult * 2),
              activation,
          ]
  
      ### resnet blocks
      mult = 2**n_downsampling
      for i in range(n_blocks):
          model += [
              ResnetBlock(
                  ngf * mult,
                  padding_type=padding_type,
                  activation=activation,
                  norm_layer=norm_layer,
              )
          ]
  
      ### upsample
      for i in range(n_downsampling):
          mult = 2 ** (n_downsampling - i)
          model += [
              nn.ConvTranspose2d(
                  ngf * mult,
                  int(ngf * mult / 2),
                  kernel_size=3,
                  stride=2,
                  padding=1,
                  output_padding=1,
              ),
              norm_layer(int(ngf * mult / 2)),
              activation,
          ]
      model += [
          nn.ReflectionPad2d(3),
          nn.Conv2d(ngf, output_nc, kernel_size=7, padding=0),
      ]
      if last_op is not None:
          model += [last_op]
      self.model = nn.Sequential(*model)
  
imports: import torch
  import torch.nn
  import functools
  from torch.autograd import Variable
  import numpy
label_desc: Use image node_id 1 to create a new GlobalGenerator object from inherited base classes: nn with example: obj = GlobalGenerator(input_nc, output_nc, ngf, n_downsampling, n_blocks, norm_layer, padding_type, last_op)