Skip to content

Commit

Permalink
Merge pull request #378 from torchsynth/torch-range
Browse files Browse the repository at this point in the history
Updating torch.range to torch.arange
  • Loading branch information
turian committed Aug 18, 2022
2 parents 23d6411 + 4bf6187 commit a51a36c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -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",
],
Expand Down
4 changes: 2 additions & 2 deletions torchsynth/profile.py
Expand Up @@ -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()
Expand All @@ -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():
Expand Down
4 changes: 2 additions & 2 deletions torchsynth/synth.py
Expand Up @@ -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
Expand Down

0 comments on commit a51a36c

Please sign in to comment.