-
Notifications
You must be signed in to change notification settings - Fork 739
Added ability to save tensors #3
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
torchaudio/__init__.py
Outdated
| func = th_sox.libthsox_Int_write_audio_file | ||
| elif isinstance(src, torch.LongTensor): | ||
| func = th_sox.libthsox_Long_write_audio_file | ||
| func(bytes(filepath), src, extension.replace('.', ''), sample_rate) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torchaudio/__init__.py
Outdated
| elif isinstance(src, torch.IntTensor): | ||
| func = th_sox.libthsox_Int_write_audio_file | ||
| elif isinstance(src, torch.LongTensor): | ||
| func = th_sox.libthsox_Long_write_audio_file |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torchaudio/__init__.py
Outdated
|
|
||
| def save(filepath, src, sample_rate): | ||
| assert torch.is_tensor(src) | ||
| assert not src.is_cuda |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
Thanks for the feedback @apaszke, made a few changes if you could review again! |
apaszke
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.
One last nit. I don't know sox so I'm leaving the review for @soumith
| audio.save( | ||
| string, # path to file | ||
| tensor, # NSamples x NChannels 2D tensor | ||
| number, # sample_rate of the audio to be saved as |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
* adding smoke test * adding smoke test * fix config.yml * trigger smoke test * test aws erc credential * test aws erc credential * test aws erc credential * test aws erc credential * adding ecr cred * test aws erc credential * test aws erc credential * test aws erc credential - different way * test aws erc credential - different way #2 * test aws erc credential - different way #3 * test aws erc credential - different way #4 * test aws #1 * test aws erc credential, after enabling circleci setting * fixing conda init * add verbose output for smoke test * add docker image build workflow * add docker image build workflow * fix aws ecr login * use images build from circelci * ready for review * updated Readme with instructions on nightly install, also updated docker image which can make nightlies installed via pip pass * nit * reduce size
Update .grad attribute type
Making CUDA optional for MNIST example
Ported the code from here to save tensors! Should also close #2, let me know if any feedback