-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Hi, I've tried your repo and find that using the same input data, hadamard_transform_cuda and hadamard_transform_torch would have different outputs.
Here is an example:
batch_size = 10
n = 64
device = 'cuda:0'
u = torch.eye(n, requires_grad = True, device = device)
u2 = u.to('cpu')
result_cuda = hadamard_transform_cuda(u)
result_torch = hadamard_transform_torch(u2)
Then the output of cuda is:
tensor([[1., 0., 0., ..., 0., 0., 0.],
[0., 1., 0., ..., 0., 0., 0.],
[0., 0., 1., ..., 0., 0., 0.],
...,
[0., 0., 0., ..., 1., 0., 0.],
[0., 0., 0., ..., 0., 1., 0.],
[0., 0., 0., ..., 0., 0., 1.]])
However, that of torch is:
tensor([[ 1., 1., 1., ..., 1., 1., 1.],
[ 1., -1., 1., ..., -1., 1., -1.],
[ 1., 1., -1., ..., 1., -1., -1.],
...,
[ 1., -1., 1., ..., -1., 1., -1.],
[ 1., 1., -1., ..., 1., -1., -1.],
[ 1., -1., -1., ..., -1., -1., 1.]])