Issue with ConvTranspose1d on MPS

ConvTranspose1d produces a different result on MPS than on the CPU. Example follows.

import torch
from torch import nn

y = torch.ones(1, 1, 2)
deconv = nn.ConvTranspose1d(in_channels=1, out_channels=1, kernel_size=1, stride=2, bias=False)
deconv.weight.data = torch.ones(1,1,2)
gpudeconv = copy.deepcopy(deconv).to(device=‘mps’)
x = deconv(y)
print (x)
ygpu = y.to(device=‘mps’)
xgpu = gpudeconv(ygpu)
print(xgpu)

Result:

tensor([[[1., 1., 1., 1.]]], grad_fn=)
tensor([[[1., 2., 1., 0.]]], device=‘mps:0’, grad_fn=)

In case you are seeing the same issue using the latest nightly binary, could you create an issue on GitHub please, so that we could track and fix it?

1 Like