Internal dimension equals to 1 does not appear in the LazyTensor.shape attribute
import numpy as np
from pykeops.numpy import LazyTensor
# work as expected
print(LazyTensor(np.ones((1,10, 2))))
# KeOps LazyTensor
# formula: Var(0,2,1)
# shape: (1, 10, 2)
# strange...
print(LazyTensor(np.ones((1,10, 1))))
# KeOps LazyTensor
# formula: Var(0,1,1)
# shape: (1, 10)
A better choice should be shape: (1, 10, 1). It yields to strange expression :
print(LazyTensor(np.ones((1,10, 2))).sum(-1).sum(-1))
# KeOps LazyTensor
# formula: Sum(Sum(Var(0,2,1)))
# shape: (1, 10)
Not coherent with
print(LazyTensor(np.ones((1,10, 2))).sum(-1).sum(1).shape)
# (1, 1)