Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to obtain torch tensor after reduction #397

Open
magrenimish opened this issue Nov 1, 2024 · 0 comments
Open

Unable to obtain torch tensor after reduction #397

magrenimish opened this issue Nov 1, 2024 · 0 comments

Comments

@magrenimish
Copy link

Hi,
I am new to using the tool and am trying out some of its functionalities! I tried the following code and was expecting 'm' to be a torch tensor after performing the argmax reduction on 'out' but 'm' turns out to be a Lazy Tensor.

`from pykeops.torch import LazyTensor
a = torch.tensor([[0.1, 0.2, 0.7],
[0, 0.2, 0.8]], requires_grad=True)

b = torch.tensor([[1, 1, 1],
[0, 1, 0],
[0, 0, 1]], dtype=torch.float)

l = LazyTensor(logits_nc[None,:,:,None,None,10]) #shape = (1,2,3)

d = LazyTensor(desc_matrix_cc[:,None,:,None,10])#shape = (3,1,3)

out = (l1*d1)#shape = (3,2,3)

m = out.argmax(dim=-1)`
Am I missing correct symbolic axes assignment when creating the lazy tensors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant