From e609fb6ca765b8f4b4503cc078abc53349d52968 Mon Sep 17 00:00:00 2001 From: mcDandy Date: Wed, 3 Sep 2025 13:41:02 +0200 Subject: [PATCH] mixup of sample and sample count in fft --- src/more_math/Parser/TensorEvalVisitor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/more_math/Parser/TensorEvalVisitor.py b/src/more_math/Parser/TensorEvalVisitor.py index 1e5faeb..94444dc 100644 --- a/src/more_math/Parser/TensorEvalVisitor.py +++ b/src/more_math/Parser/TensorEvalVisitor.py @@ -144,8 +144,8 @@ class TensorEvalVisitor(MathExprVisitor): time_shape = self.variables['a'].shape if 'a' in self.variables else time_shape self.shape = time_shape shp_time = torch.zeros(time_shape, device=self.variables.get('device', 'cpu')) - self.variables['T'] = getIndexTensorAlongDim(shp_time, 2) - self.variables['S'] = torch.full_like(shp_time, self.shape[2]) + self.variables['S'] = getIndexTensorAlongDim(shp_time, 2) + self.variables['T'] = torch.full_like(shp_time, self.shape[2]) self.variables['B'] = getIndexTensorAlongDim(shp_time, 0) self.variables['C'] = getIndexTensorAlongDim(shp_time, 1) self.variables['R'] = torch.full_like(shp_time, self.variables['R'].flatten()[0].item()) @@ -164,7 +164,7 @@ class TensorEvalVisitor(MathExprVisitor): self.variables['T'] = getIndexTensorAlongDim(shp_freq, 3) # now frame index self.variables['B'] = getIndexTensorAlongDim(shp_freq, 0) self.variables['C'] = getIndexTensorAlongDim(shp_freq, 1) - self.variables['S'] = getIndexTensorAlongDim(shp_freq, 2) + self.variables['F'] = getIndexTensorAlongDim(shp_freq, 2) self.variables['R'] = torch.full_like(shp_freq, self.variables['R'].flatten()[0].item()) # Convert time→freq