Skip to content
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

Remove unused helper function #1396

Merged
merged 1 commit into from
Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 0 additions & 18 deletions torchaudio/csrc/sox/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,24 +141,6 @@ caffe2::TypeMeta get_dtype(
return c10::scalarTypeToTypeMeta(dtype);
}

caffe2::TypeMeta get_dtype_from_str(const std::string dtype) {
const auto tgt_dtype = [&]() {
if (dtype == "uint8")
return torch::kUInt8;
else if (dtype == "int16")
return torch::kInt16;
else if (dtype == "int32")
return torch::kInt32;
else if (dtype == "float32")
return torch::kFloat32;
else if (dtype == "float64")
return torch::kFloat64;
else
throw std::runtime_error("Unsupported dtype");
}();
return c10::scalarTypeToTypeMeta(tgt_dtype);
}

torch::Tensor convert_to_tensor(
sox_sample_t* buffer,
const int32_t num_samples,
Expand Down
2 changes: 0 additions & 2 deletions torchaudio/csrc/sox/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ caffe2::TypeMeta get_dtype(
const sox_encoding_t encoding,
const unsigned precision);

caffe2::TypeMeta get_dtype_from_str(const std::string dtype);

///
/// Convert sox_sample_t buffer to uint8/int16/int32/float32 Tensor
/// NOTE: This function might modify the values in the input buffer to
Expand Down