I’m using Transposed Convolutions in my network and I want to keep the shape of the output 3rd(indexing from 1) dimension same as in input. How can I do that with ConvTranspose3d() ?
import torch

import torch.nn as nn

x = torch.randn(1,3,1,128,128).cuda()

layer = nn.ConvTranspose3d(in_channels=3,out_channels=3,kernel_size=4,stride=2,padding=1).cuda()

output = layer(x)

print(output.shape)

Actual Output: (1,3,2,256,256)
Expected Output : (1,3,1,256,256)