From 74d5ad30920a78358a5f4b448dc01341114a65f1 Mon Sep 17 00:00:00 2001 From: RichieHakim Date: Sat, 10 Feb 2024 20:41:49 -0500 Subject: [PATCH] Fix __repr__ --- vqt/vqt.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/vqt/vqt.py b/vqt/vqt.py index 0dceba7..ccd4bc6 100644 --- a/vqt/vqt.py +++ b/vqt/vqt.py @@ -243,14 +243,11 @@ def __repr__(self): if self.using_custom_filters: return f"VQT with custom filters" else: - # return f"VQT object with parameters: {''.join([f'{k}={getattr(self, k)}, ' for k, v in self.__dict__.items() if k not in ['filters', 'freqs', 'wins']])[:-2]}" - ## Below lines are because torch.jit.script doesn't allow comprehension if statements attributes_to_print = [] for k, v in self.__dict__.items(): - if k not in ['filters', 'freqs', 'wins']: + if (k not in ['filters', 'freqs', 'wins']) and (not k.startswith('_')) and (not callable(v)): attributes_to_print.append(k) - return f"VQT object with parameters: {''.join([f'{k}={getattr(self, k)}, ' for k in attributes_to_print])[:-2]}" - + return f"VQT object with parameters: {''.join([f'{k}={getattr(self, k)}, ' for k in attributes_to_print])[:-2]}" def downsample(