Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Torchaudio
Commits
d1d6dbc6
Unverified
Commit
d1d6dbc6
authored
Jul 27, 2021
by
Zack Kneupper
Committed by
GitHub
Jul 27, 2021
Browse files
Simplify axis value checks (#1501)
parent
d49e6e45
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
torchaudio/functional/functional.py
torchaudio/functional/functional.py
+2
-2
No files found.
torchaudio/functional/functional.py
View file @
d1d6dbc6
...
@@ -732,7 +732,7 @@ def mask_along_axis_iid(
...
@@ -732,7 +732,7 @@ def mask_along_axis_iid(
Tensor: Masked spectrograms of dimensions (batch, channel, freq, time)
Tensor: Masked spectrograms of dimensions (batch, channel, freq, time)
"""
"""
if
axis
!=
2
and
axis
!=
3
:
if
axis
not
in
[
2
,
3
]
:
raise
ValueError
(
'Only Frequency and Time masking are supported'
)
raise
ValueError
(
'Only Frequency and Time masking are supported'
)
device
=
specgrams
.
device
device
=
specgrams
.
device
...
@@ -774,7 +774,7 @@ def mask_along_axis(
...
@@ -774,7 +774,7 @@ def mask_along_axis(
Returns:
Returns:
Tensor: Masked spectrogram of dimensions (channel, freq, time)
Tensor: Masked spectrogram of dimensions (channel, freq, time)
"""
"""
if
axis
!=
1
and
axis
!=
2
:
if
axis
not
in
[
1
,
2
]
:
raise
ValueError
(
'Only Frequency and Time masking are supported'
)
raise
ValueError
(
'Only Frequency and Time masking are supported'
)
# pack batch
# pack batch
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment