Thanks for creating this library!
I'm trying to use keops to implement a formula that involves element-wise addition between two 2D matrices. This is the basic format:
# x = (N,F), y=(M,F)
x_i = LazyTensor(x[:, None, :])
y_j = LazyTensor(x[None, :, :])
C_ij = ((x_i - y_j)**2).sum(dim=2)**0.5 # (N,M)
# Z_ij = (N,M)
O_ij = C_ij + Z_ij # (N,M)
Z_ij is a pre-defined torch tensor. When I try to convert Z_ij to a LazyTensor (ie Z_ij = LazyTensor(Z_torch, 0)), the axis specification causes the addition to return a tensor of size (N,M,M) rather than a (N,M) tensor.
Is element-wise addition between two 2D matrices possible with LazyTensors?
Thanks for creating this library!
I'm trying to use keops to implement a formula that involves element-wise addition between two 2D matrices. This is the basic format:
Z_ijis a pre-defined torch tensor. When I try to convertZ_ijto aLazyTensor(ieZ_ij = LazyTensor(Z_torch, 0)), the axis specification causes the addition to return a tensor of size(N,M,M)rather than a(N,M)tensor.Is element-wise addition between two 2D matrices possible with LazyTensors?