Skip to content

Commit

Permalink
Merge pull request #154 from miccio-dk/master
Browse files Browse the repository at this point in the history
specify device for RandomCrop output variable
  • Loading branch information
iver56 authored Aug 3, 2022
2 parents 1e74ce8 + 0c3b0b9 commit 1590056
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion torch_audiomentations/augmentations/random_crop.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def forward(self, samples, sampling_rate: typing.Optional[int] = None):
0, samples.shape[2] - self.num_samples, (samples.shape[2],)
)
samples_cropped = torch.empty(
(samples.shape[0], samples.shape[1], self.num_samples)
(samples.shape[0], samples.shape[1], self.num_samples),
device=samples.device
)
for i, sample in enumerate(samples):

Expand Down

0 comments on commit 1590056

Please sign in to comment.