From 9a09ac6ce50b9d89c6a761e1427a60ba1214ceb2 Mon Sep 17 00:00:00 2001 From: jorshi Date: Mon, 15 Aug 2022 23:07:12 -0700 Subject: [PATCH 1/4] Updating torch.range to torch.arange in _batch_idx_to_is_train --- torchsynth/synth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/torchsynth/synth.py b/torchsynth/synth.py index 8787ca3e..74366acd 100644 --- a/torchsynth/synth.py +++ b/torchsynth/synth.py @@ -239,9 +239,9 @@ def _batch_idx_to_is_train( Determine which samples are training examples if batch_idx is provided """ if batch_idx is not None: - idxs = torch.range( + idxs = torch.arange( self.batch_size * batch_idx, - self.batch_size * (batch_idx + 1) - 1, + self.batch_size * (batch_idx + 1), device=self.device, ) assert len(idxs) == self.batch_size From f3e3838913643fabbad435cbb8453986f08df339 Mon Sep 17 00:00:00 2001 From: jorshi Date: Wed, 17 Aug 2022 09:23:52 -0700 Subject: [PATCH 2/4] test_dataloaders parameter has been deprecated and removed from PTL --- torchsynth/profile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/torchsynth/profile.py b/torchsynth/profile.py index fb60642f..55c2cbd3 100644 --- a/torchsynth/profile.py +++ b/torchsynth/profile.py @@ -110,7 +110,7 @@ def run_lightning_module( # Run module with profiling pr = cProfile.Profile() pr.enable() - trainer.test(module, test_dataloaders=dataloader) + trainer.test(module, dataloaders=dataloader) pr.disable() s = io.StringIO() @@ -132,7 +132,7 @@ def run_lightning_module( print(s.getvalue()) else: - trainer.test(module, test_dataloaders=dataloader) + trainer.test(module, dataloaders=dataloader) def main(): From 395c6ab35a11caba4c2122dbe7b00581e2b9e0ae Mon Sep 17 00:00:00 2001 From: jorshi Date: Wed, 17 Aug 2022 10:04:22 -0700 Subject: [PATCH 3/4] Minimum lightning version is 1.4 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index cbc2a12a..5a2686c6 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ "numpy", "scipy", "torch>=1.8", - "pytorch-lightning", + "pytorch-lightning>=1.4", # pypi release (only master) doesn't support OrderedDict typing # "typing-extensions", ], From 2568daa21a0f0f1bccb004dca432d301fb127736 Mon Sep 17 00:00:00 2001 From: jorshi Date: Wed, 17 Aug 2022 10:33:15 -0700 Subject: [PATCH 4/4] codecov action omits temporary file created by torch --- .github/workflows/codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 7116e9c6..e3a8536e 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -31,7 +31,7 @@ jobs: run: | # Limit to coverage of source files in current directory coverage run -m examples.examples --source=. - coverage xml + coverage xml --omit "*_remote_module_non_scriptable.py" - name: Upload coverage to Codecov uses: codecov/codecov-action@v1.2.0 with: