Skip to content

Commit dd76e9d

Browse files
authored
Remove unused helper function (#1396)
1 parent 4100ad8 commit dd76e9d

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

torchaudio/csrc/sox/utils.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,6 @@ caffe2::TypeMeta get_dtype(
141141
return c10::scalarTypeToTypeMeta(dtype);
142142
}
143143

144-
caffe2::TypeMeta get_dtype_from_str(const std::string dtype) {
145-
const auto tgt_dtype = [&]() {
146-
if (dtype == "uint8")
147-
return torch::kUInt8;
148-
else if (dtype == "int16")
149-
return torch::kInt16;
150-
else if (dtype == "int32")
151-
return torch::kInt32;
152-
else if (dtype == "float32")
153-
return torch::kFloat32;
154-
else if (dtype == "float64")
155-
return torch::kFloat64;
156-
else
157-
throw std::runtime_error("Unsupported dtype");
158-
}();
159-
return c10::scalarTypeToTypeMeta(tgt_dtype);
160-
}
161-
162144
torch::Tensor convert_to_tensor(
163145
sox_sample_t* buffer,
164146
const int32_t num_samples,

torchaudio/csrc/sox/utils.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ caffe2::TypeMeta get_dtype(
6868
const sox_encoding_t encoding,
6969
const unsigned precision);
7070

71-
caffe2::TypeMeta get_dtype_from_str(const std::string dtype);
72-
7371
///
7472
/// Convert sox_sample_t buffer to uint8/int16/int32/float32 Tensor
7573
/// NOTE: This function might modify the values in the input buffer to

0 commit comments

Comments
 (0)