Commit a26c2f27 authored by moto's avatar moto Committed by Facebook GitHub Bot
Browse files

Deprecate the use of Tensor as a mean of passing byte string (#3086)

Summary:
The same functionality can be achieved with passing io.BytesIO to the constructor.

Pull Request resolved: https://github.com/pytorch/audio/pull/3086

Reviewed By: nateanl

Differential Revision: D43500360

Pulled By: mthrok

fbshipit-source-id: 2c6f37d100f50553b283c75c04fe57c8f9c07dc9
parent 3b75b74f
...@@ -119,6 +119,8 @@ TORCH_LIBRARY_FRAGMENT(torchaudio, m) { ...@@ -119,6 +119,8 @@ TORCH_LIBRARY_FRAGMENT(torchaudio, m) {
const c10::optional<std::string>& device, const c10::optional<std::string>& device,
const c10::optional<OptionDict>& option, const c10::optional<OptionDict>& option,
int64_t buffer_size) { int64_t buffer_size) {
TORCH_WARN_ONCE(
"Using Tensor as byte string buffer is deprecated, and will be removed in 2.1, please pass the data using I/O object.")
return c10::make_intrusive<StreamReaderTensorBinding>( return c10::make_intrusive<StreamReaderTensorBinding>(
src, device, option, static_cast<int>(buffer_size)); src, device, option, static_cast<int>(buffer_size));
})) }))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment