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
Get rid of typedefs/SignalInfo and replace AudioMetaData #761
Conversation
d9b4ad2
to
177a866
Compare
Codecov Report
@@ Coverage Diff @@
## master #761 +/- ##
==========================================
+ Coverage 89.16% 89.35% +0.19%
==========================================
Files 32 32
Lines 2566 2556 -10
==========================================
- Hits 2288 2284 -4
+ Misses 278 272 -6
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
assert info.get_sample_rate() == sample_rate | ||
assert info.get_num_frames() == sample_rate * duration | ||
assert info.get_num_channels() == num_channels | ||
assert info.sample_rate == sample_rate | ||
assert info.num_frames == sample_rate * duration | ||
assert info.num_channels == num_channels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functions are still in there so the change is not BC breaking, right? Is there a reason why you are updating the tests then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functions are still in there so the change is not BC breaking, right?
No. These get_*
functions are removed so this is BC breaking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a user tries to use them, what will happen? I don't see any instructions to the user on what to do?
177a866
to
e994869
Compare
e994869
to
c9eed5b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make sure we have the warnings in place to let the users know what to do if they encounter errors for missing operations.
That approach is good for stable released feature, but considering the product lifecycle of "sox_io" backed, which is still under heavy development, I do not think that really fits. |
What I meant above when I asked if something was BC-breaking was whether this was changing the existing "sox" (not "sox_io") interface. "sox_io" has not been part of a release yet, so we don't need to add warnings when we are changing the interface.
Can you clarify the response? |
This changes the function signature of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying :) LGTM
thanks |
This PR removes
typedefs.[h|cpp]
, movesSignalInfo
fromtorchaudio
namespace totorchaudio::sox_io
, removes dummy module from Python interface, then replaceinfo
return type withAudioMetaData
.torchaudio::sox_io::SignalInfo
struct was expected be data exchange structure between Python and C++ for allinfo
,load
andsave
function ofsox_io
backend. However, as I simplify the function signature ofsave
andload
, they end up not needing such structure, and nowinfo
function is the only function that usetorchaudio::sox_io::SignalInfo
struct.On Python API level, we can replace this struct with simple Python class while keeping Torchscript-ability. This removes the necessity to introduce dummy module because we no longer need to annotate
info
function withtorchaudio::sox_io::SignalInfo
.