Hi,
Why do you try to change the weights?
You can check just after creating the layer what are the correct sizes:
transpose=torch.nn.ConvTranspose2d(1,1,kernel_size=1,stride=2)
print(transpose.weight.size())
print(transpose.bias.size())

The weight and bias Tensors you create are not of the right size.