Hi would I able to put ConvTranspose2d  in Sequential and adding other layers and writing output_size.
I am working on wgan, where I want to experiment with both different Upsample layer with it,
Like this, I used both layers just to increase image dimensions by 2
def upconv(in_channels, out_channels, kernel_size=1, stride=1, padding=0, batch_norm=True, up=False, trans=True):
    layers = []
    # conv_layer = nn.Conv2d(in_channels, out_channels, kernel_size, stride, padding, padding_mode=padding_mode)
    if up:
        layers.append(nn.Upsample(scale_factor=scale_factor, mode=mode, align_corners=align_corners))
    if trans:
      layers.append(nn.ConvTranspose2d(in_channels, out_channels, kernel_size, stride=stride, padding=padding))
      
    if batch_norm:
        layers.append(nn.BatchNorm2d(out_channels))
    return nn.Sequential(*layers)

but Upsample works , but for ConvTranspose2d I need to write output_size so that it would just double dimension , but It is not possible
a = torch.randn((1, 32, 16, 16))
upconv(32, 16)(a, output_size=(a.shape[0], a.shape[1], a.shape[2]*2, a.shape[3]*2))

How can i do this?