Correction to my solution:
torch.nn.ConvTranspose3d(
    in_channels=number_of_filters,
    out_channels=number_of_filters,
    kernel_size=kernel_size,
    stride=2,
    padding=kernel_size//2 - (1 - kernel_size % 2),
    output_padding=kernel_size % 2,
)