Here is the stack trace of my error, as well as the section of the code that caused it beneath - could someone help me figure out it means please?
Error
result = self.forward(*input, **kwargs)

File “/home/mia/CV/PyTorch-GAN/implementations/cyclegan/models.py”, line 87, in forward
return self.model(x)
File “/home/mia/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py”, line 477, in call
result = self.forward(*input, **kwargs)
File “/home/mia/anaconda3/lib/python3.6/site-packages/torch/nn/modules/container.py”, line 91, in forward
input = module(input)
File “/home/mia/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py”, line 477, in call
result = self.forward(*input, **kwargs)
File “/home/mia/anaconda3/lib/python3.6/site-packages/torch/nn/modules/padding.py”, line 163, in forward
return F.pad(input, self.padding, ‘reflect’)
File “/home/mia/anaconda3/lib/python3.6/site-packages/torch/nn/functional.py”, line 2163, in pad
assert len(pad) == 2, ‘3D tensors expect 2 values for padding’
AssertionError: 3D tensors expect 2 values for padding
Code:
class GeneratorResNet(nn.Module):
def init(self, input_shape, num_residual_blocks):
super(GeneratorResNet, self).init()
channels = input_shape[0]
    # Initial convolution block
    out_features = 64
    model = [
        nn.ReflectionPad2d(channels),
        nn.Conv2d(channels, out_features, 7),
        nn.InstanceNorm2d(out_features),
        nn.ReLU(inplace=True),
    ]
    in_features = out_features

    # Downsampling
    for _ in range(2):
        out_features *= 2
        model += [
            nn.Conv2d(in_features, out_features, 3, stride=2, padding=1),
            nn.InstanceNorm2d(out_features),
            nn.ReLU(inplace=True),
        ]
        in_features = out_features

    # Residual blocks
    for _ in range(num_residual_blocks):
        model += [ResidualBlock(out_features)]

    # Upsampling
    for _ in range(2):
        out_features //= 2
        model += [
            nn.Upsample(scale_factor=2),
            nn.Conv2d(in_features, out_features, 3, stride=1, padding=1),
            nn.InstanceNorm2d(out_features),
            nn.ReLU(inplace=True),
        ]
        in_features = out_features

    # Output layer
    model += [nn.ReflectionPad2d(channels), nn.Conv2d(out_features, channels, 7), nn.Tanh()]

    self.model = nn.Sequential(*model)

def forward(self, x):
    return self.model(x)