bdube:

x = torch.linspace(-1, 1, 128).cuda()
y = torch.linspace(-1, 1, 128).cuda()


This is unfair comparison. Here you are building things in CPU and then transfer to GPU. A better comparison is to measure the computation time after constructing tensors.