I'm using pykeops.torch.Genred with a formula string and list of aliases to evaluate a matrix/vector product. My matrix expression is somewhat complex and the full matvec needs to be evaluated in parts.
Unfortunately, the backward pass of the reduction is giving the error:
RuntimeError: [Keops] Arg at position 10: is not contiguous. Please provide 'contiguous' dara array, as KeOps does not support strides. If you're getting this error in the 'backward' pass of a code using torch.sum() on the output of a KeOps routine, you should consider replacing 'a.sum()' with 'torch.dot(a.view(-1), torch.ones_like(a).view(-1))'.
The suggestion in the error message (to use a dot product with ones()) does not seem directly applicable here (there isn't a Dot reduction for Genred AFAIK). Is there a way to fix this without rewriting my code using lazy tensors?
Hi,
I'm using
pykeops.torch.Genred
with a formula string and list of aliases to evaluate a matrix/vector product. My matrix expression is somewhat complex and the full matvec needs to be evaluated in parts.Unfortunately, the backward pass of the reduction is giving the error:
The backward reduction is:
The suggestion in the error message (to use a dot product with
ones()
) does not seem directly applicable here (there isn't aDot
reduction forGenred
AFAIK). Is there a way to fix this without rewriting my code using lazy tensors?