From 46a3a3a97deea0ff9a24932a70e3e92b98a17309 Mon Sep 17 00:00:00 2001 From: Yin Li Date: Tue, 21 Jan 2020 18:49:45 -0500 Subject: [PATCH] Fix augmentation bug --- map2map/data/fields.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/map2map/data/fields.py b/map2map/data/fields.py index 2a647ae..5d01272 100644 --- a/map2map/data/fields.py +++ b/map2map/data/fields.py @@ -156,8 +156,8 @@ def flip(fields, axes, ndim): if x.shape[0] == ndim: # flip vector components x[axes] = - x[axes] - axes = (1 + axes).tolist() - x = torch.flip(x, axes) + shifted_axes = (1 + axes).tolist() + x = torch.flip(x, shifted_axes) new_fields.append(x) @@ -172,8 +172,8 @@ def perm(fields, axes, ndim): if x.shape[0] == ndim: # permutate vector components x = x[axes] - axes = [0] + (1 + axes).tolist() - x = x.permute(axes) + shifted_axes = [0] + (1 + axes).tolist() + x = x.permute(shifted_axes) new_fields.append(x)