Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make parameter optional string #641

Merged
merged 3 commits into from May 27, 2020
Merged

Conversation

vincentqb
Copy link
Contributor

Following up on comment

@vincentqb vincentqb requested a review from mthrok May 14, 2020 23:37
@codecov
Copy link

codecov bot commented May 14, 2020

Codecov Report

Merging #641 into master will decrease coverage by 0.03%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #641      +/-   ##
==========================================
- Coverage   88.84%   88.80%   -0.04%     
==========================================
  Files          21       21              
  Lines        2223     2225       +2     
==========================================
+ Hits         1975     1976       +1     
- Misses        248      249       +1     
Impacted Files Coverage Δ
torchaudio/functional.py 95.13% <66.66%> (-0.13%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 241ab1e...07614e9. Read the comment docs.

@vincentqb vincentqb marked this pull request as ready for review May 14, 2020 23:55
@@ -376,7 +376,7 @@ def create_fb_matrix(
up_slopes = slopes[:, 2:] / f_diff[1:] # (n_freqs, n_mels)
fb = torch.max(zero, torch.min(down_slopes, up_slopes))

if norm == "slaney":
if norm is not None and norm == "slaney":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not allow values other than "slaney" or None to prevent the case where unintended value is passed, like typo.

Copy link
Collaborator

@mthrok mthrok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly looks good.

@mthrok
Copy link
Collaborator

mthrok commented May 26, 2020

@vincentqb Test needs to be fixed.

@@ -83,7 +83,7 @@ def func(_):
f_max = 20.0
n_mels = 10
sample_rate = 16000
norm = ""
norm = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than changing it to None, I suggest following the original suggestion of passing string value.

@vincentqb vincentqb merged commit b985609 into pytorch:master May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants