pytorch/torch/utils
Jan Schlüter 6a206df891 20000x faster audio conversion for SummaryWriter (#44201)
Summary:
Stumbled upon a little gem in the audio conversion for `SummaryWriter.add_audio()`: two Python `for` loops 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?

Pull Request resolved: https://github.com/pytorch/pytorch/pull/44201

Reviewed By: J0Nreynolds

Differential Revision: D23831002

Pulled By: edward-io

fbshipit-source-id: 5c8f1ac7823d1ed41b53c4f97ab9a7bac33ea94b
2020-09-28 15:44:29 -07:00
..
_benchmark Gh/taylorrobie/timer cleanup (#45361) 2020-09-28 14:56:43 -07:00
backcompat
bottleneck Fix type annotations for a number of torch.utils submodules (#42711) 2020-08-14 18:12:48 -07:00
data Revert D23725053: [pytorch][PR] change self.generator to generator 2020-09-17 09:42:37 -07:00
ffi remove support for c extensions (#12122) 2018-10-01 13:55:28 -07:00
hipify Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
tensorboard 20000x faster audio conversion for SummaryWriter (#44201) 2020-09-28 15:44:29 -07:00
__init__.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
_cpp_extension_versioner.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
bundled_inputs.py add typing annotations for a few torch.utils.* modules (#43806) 2020-09-11 10:20:55 -07:00
checkpoint.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
collect_env.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
cpp_extension.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
dlpack.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
file_baton.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
hooks.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
mkldnn.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
mobile_optimizer.py [vulkan][py] torch.utils.optimize_for_vulkan (#44903) 2020-09-18 18:20:11 -07:00
model_zoo.py add/move a few apis in torch.hub (#18758) 2019-04-10 23:10:39 -07:00
show_pickle.py Add torch.utils.show_pickle for showing pickle contents in saved models (#35168) 2020-04-03 15:11:20 -07:00
throughput_benchmark.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00