From 7e0d32924fda14c2ddfe23a63616eac33476d83c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Fleuret?= Date: Wed, 24 May 2023 17:39:28 +0200 Subject: [PATCH] Update. --- eingather.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/eingather.py b/eingather.py index 5732a3c..734edbe 100755 --- a/eingather.py +++ b/eingather.py @@ -15,11 +15,11 @@ def eingather(op, src, *indexes): s_indexes = re.findall("\(([^)]*)\)", s_src) s_src = re.sub("\([^)]*\)", "_", s_src) - all_sizes = tuple(d for s in ( src, ) + indexes for d in s.size()) + all_sizes = tuple(d for s in (src,) + indexes for d in s.size()) s_all = "".join([s_src] + s_indexes) shape = tuple(all_sizes[s_all.index(v)] for v in s_dst) - def do(x,s_x): + def do(x, s_x): idx = [] n_index = 0 @@ -39,7 +39,8 @@ def eingather(op, src, *indexes): return x[idx] - return do(src,s_src) + return do(src, s_src) + ####################### -- 2.39.5