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

Move I/O related Tensor ops to misc_ops module #694

Merged
merged 1 commit into from Jun 5, 2020

Conversation

mthrok
Copy link
Collaborator

@mthrok mthrok commented Jun 4, 2020

check_input and audio_normalization functions defined in __init__.py, _backend.py and _soundfilebackend (duplicated) are referred from multiple modules and cause cyclic module dependencies and preventing modularizing backends. This PR resolve this by putting them in a separate dedicated module _internal.misc_ops.

Also change the helper function name from audio_normalization (noun) to normalize_audio (verb) for consistency.

@codecov
Copy link

codecov bot commented Jun 4, 2020

Codecov Report

Merging #694 into master will increase coverage by 0.10%.
The diff coverage is 82.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #694      +/-   ##
==========================================
+ Coverage   89.19%   89.29%   +0.10%     
==========================================
  Files          22       23       +1     
  Lines        2341     2335       -6     
==========================================
- Hits         2088     2085       -3     
+ Misses        253      250       -3     
Impacted Files Coverage Δ
torchaudio/sox_effects.py 87.64% <66.66%> (ø)
torchaudio/_internal/misc_ops.py 76.47% <76.47%> (ø)
torchaudio/__init__.py 83.95% <100.00%> (+1.34%) ⬆️
torchaudio/_backend.py 94.11% <100.00%> (+6.11%) ⬆️
torchaudio/_soundfile_backend.py 96.92% <100.00%> (+2.72%) ⬆️
torchaudio/_sox_backend.py 94.44% <100.00%> (ø)

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 9f3075c...67e2947. Read the comment docs.

@mthrok mthrok changed the title Add proper modularization to common_utils Add common_ops module for misc Tensor ops Jun 5, 2020
@mthrok mthrok force-pushed the module-utils branch 2 times, most recently from 4accd98 to 3d3e92d Compare June 5, 2020 18:15
@mthrok mthrok changed the title Add common_ops module for misc Tensor ops Add I/O related Tensor ops to misc_ops module Jun 5, 2020
@mthrok mthrok marked this pull request as ready for review June 5, 2020 19:16
@mthrok mthrok requested a review from vincentqb June 5, 2020 19:16
@mthrok mthrok changed the title Add I/O related Tensor ops to misc_ops module Move I/O related Tensor ops to misc_ops module Jun 5, 2020
Copy link
Contributor

@vincentqb vincentqb left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,30 @@
from typing import Union, Callable
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: That's a very generic name for the file :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I do not know what to call, but this is just evicting these functions from __init__.py so if this module glows into something then we can have a better naming.

@mthrok mthrok merged commit e5eb485 into pytorch:master Jun 5, 2020
@mthrok
Copy link
Collaborator Author

mthrok commented Jun 5, 2020

Thanks!

@mthrok mthrok deleted the module-utils branch June 5, 2020 21:14
mpc001 pushed a commit to mpc001/audio that referenced this pull request Aug 4, 2023
…onduct_file_exists

Adding Code of Conduct file
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