From aba8c24651a269ca5e73c7074f60aef047d6ac80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Glaun=C3=A8s?= Date: Tue, 28 Mar 2023 09:59:26 +0000 Subject: [PATCH] update --- pykeops/pykeops/sandbox/issue_292.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 pykeops/pykeops/sandbox/issue_292.py diff --git a/pykeops/pykeops/sandbox/issue_292.py b/pykeops/pykeops/sandbox/issue_292.py new file mode 100644 index 000000000..3a94ffbbb --- /dev/null +++ b/pykeops/pykeops/sandbox/issue_292.py @@ -0,0 +1,13 @@ +import torch + +from pykeops.torch import LazyTensor +#LazyTensor = lambda x:x + +N, M, C = 5000, 2000, 10 +a = LazyTensor(torch.randn(1, N, C)) +b = LazyTensor(torch.randn(M, 1, C)) +c = ((a-b)**2).sum(axis=2) +print(c.shape) # this gives [M, N] +d = c[:,10:20] +print(d.shape) # this gives an error, but I hope to get the shape [M, 10] +