From: François Fleuret Date: Wed, 24 May 2023 15:39:28 +0000 (+0200) Subject: Update. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=7e0d32924fda14c2ddfe23a63616eac33476d83c;p=pytorch.git Update. --- 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) + #######################