UnetGenerator (
  (model): UnetSkipConnectionBlock (
    (model): Sequential (
      (0): Conv2d(3, 64, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
      (1): UnetSkipConnectionBlock (
        (model): Sequential (
          (0): LeakyReLU (0.2, inplace)
          (1): Conv2d(64, 128, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
          (2): InstanceNorm2d(128, eps=1e-05, momentum=0.1, affine=True)
          (3): UnetSkipConnectionBlock (
            (model): Sequential (
              (0): LeakyReLU (0.2, inplace)
              (1): Conv2d(128, 256, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
              (2): InstanceNorm2d(256, eps=1e-05, momentum=0.1, affine=True)
              (3): UnetSkipConnectionBlock (
                (model): Sequential (
                  (0): LeakyReLU (0.2, inplace)
                  (1): Conv2d(256, 512, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
                  (2): InstanceNorm2d(512, eps=1e-05, momentum=0.1, affine=True)
                  (3): UnetSkipConnectionBlock (
                    (model): Sequential (
                      (0): LeakyReLU (0.2, inplace)
                      (1): Conv2d(512, 512, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
                      (2): InstanceNorm2d(512, eps=1e-05, momentum=0.1, affine=True)
                      (3): UnetSkipConnectionBlock (
                        (model): Sequential (
                          (0): LeakyReLU (0.2, inplace)
                          (1): Conv2d(512, 512, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
                          (2): InstanceNorm2d(512, eps=1e-05, momentum=0.1, affine=True)
                          (3): UnetSkipConnectionBlock (
                            (model): Sequential (
                              (0): LeakyReLU (0.2, inplace)
                              (1): Conv2d(512, 512, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
                              (2): InstanceNorm2d(512, eps=1e-05, momentum=0.1, affine=True)
                              (3): UnetSkipConnectionBlock (
                                (model): Sequential (
                                  (0): LeakyReLU (0.2, inplace)
                                  (1): Conv2d(512, 512, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
                                  (2): ReLU (inplace)
                                  (3): ConvTranspose2d(512, 512, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
                                  (4): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True)
                                )
                              )
                              (4): ReLU (inplace)
                              (5): ConvTranspose2d(1024, 512, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
                              (6): InstanceNorm2d(512, eps=1e-05, momentum=0.1, affine=True)
                            )
                          )
                          (4): ReLU (inplace)
                          (5): ConvTranspose2d(1024, 512, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
                          (6): InstanceNorm2d(512, eps=1e-05, momentum=0.1, affine=True)
                        )
                      )
                      (4): ReLU (inplace)
                      (5): ConvTranspose2d(1024, 512, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
                      (6): InstanceNorm2d(512, eps=1e-05, momentum=0.1, affine=True)
                    )
                  )
                  (4): ReLU (inplace)
                  (5): ConvTranspose2d(1024, 256, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
                  (6): InstanceNorm2d(256, eps=1e-05, momentum=0.1, affine=True)
                )
              )
              (4): ReLU (inplace)
              (5): ConvTranspose2d(512, 128, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
              (6): InstanceNorm2d(128, eps=1e-05, momentum=0.1, affine=True)
            )
          )
          (4): ReLU (inplace)
          (5): ConvTranspose2d(256, 64, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
          (6): InstanceNorm2d(64, eps=1e-05, momentum=0.1, affine=True)
        )
      )
      (2): ReLU (inplace)
      (3): ConvTranspose2d(128, 3, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
      (4): Tanh ()
    )
  )
)

For example:

How to get the module Conv2d(128, 256, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))

How to get the module (5): ConvTranspose2d(256, 64, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
I want to change the attributes of certain layer in training in every iteration. Thank you in advance.