Open JonasDeSchouwer opened 3 months ago
The title says it all.
Minimal example:
import torch from pykeops.torch import LazyTensor x = LazyTensor(torch.rand((5,1,8))) print(x.shape) # (5,1,8) -> correct print(x.ndim) # 8 -> incorrect: always x.shape[-1]
As you can see, the last print should have '3' as output, but instead has '8'. Some experimenting showed that the returned value seems to always be x.shape[-1].
x.shape[-1]
My environment:
As a remark, I noticed the same thing and resorted to using len(x.shape).
len(x.shape)
Yes, I did the same. But it would of course be nicer (and not lead to weird errors for developers expecting the normal behaviour)
The title says it all.
Minimal example:
As you can see, the last print should have '3' as output, but instead has '8'. Some experimenting showed that the returned value seems to always be
x.shape[-1]
.My environment: