-
Notifications
You must be signed in to change notification settings - Fork 26.3k
20000x faster audio conversion for SummaryWriter #44201
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
Conversation
💊 CI failures summary and remediationsAs of commit 4835ddc (more details on the Dr. CI page):
🕵️ 3 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
7bcb5f6 to
4dc8571
Compare
|
Pytorch does not depend on numpy, so you can't directly use numpy. I'm not sure if this is true for tensorboard. |
Good call, but numpy was already imported and used in that file before my change, and the first thing the |
facebook-github-bot
left a comment
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.
@edward-io has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
edward-io
left a comment
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.
Looks great to me, thanks for your contribution @f0k. Small nit on imports.
Feel free to open a separate PR for stereo waveforms.
4dc8571 to
43f758d
Compare
43f758d to
4835ddc
Compare
facebook-github-bot
left a comment
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.
@edward-io has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
Thanks @f0k! |
|
@edward-io merged this pull request in 6a206df. |
Stumbled upon a little gem in the audio conversion for
SummaryWriter.add_audio(): two Pythonforloops to convert a float array to little-endian int16 samples. On my machine, this took 35 seconds for a 30-second 22.05 kHz excerpt. The same can be done directly in numpy in 1.65 milliseconds. (No offense, I'm glad that the functionality was there!)Would also be ready to extend this to support stereo waveforms, or should this become a separate PR?