[3/N] Remove inclusion of c10/util/string_utils.h (#128504)

Follows #128372

Pull Request resolved: https://github.com/pytorch/pytorch/pull/128504
Approved by: https://github.com/malfet
This commit is contained in:
cyy
2024-06-15 06:38:40 +00:00
committed by PyTorch MergeBot
parent 472211c97a
commit e4c32d14a8
3 changed files with 5 additions and 7 deletions

View File

@ -28,8 +28,6 @@
#include <c10/macros/Macros.h>
#include "c10/util/string_utils.h"
namespace caffe2 {
// Using statements for common classes that we refer to in caffe2 very often.

View File

@ -213,9 +213,9 @@ void PyTorchStreamReader::init() {
if (version_ < static_cast<decltype(version_)>(kMinSupportedFileFormatVersion)) {
CAFFE_THROW(
"Attempted to read a PyTorch file with version ",
c10::to_string(version_),
std::to_string(version_),
", but the minimum supported version for reading is ",
c10::to_string(kMinSupportedFileFormatVersion),
std::to_string(kMinSupportedFileFormatVersion),
". Your PyTorch script module file is too old. Please regenerate it",
" with latest version of PyTorch to mitigate this issue.");
}
@ -733,7 +733,7 @@ void PyTorchStreamWriter::writeEndOfFile() {
auto allRecords = getAllWrittenRecords();
// If no ".data/version" or "version" record in the output model, rewrites version info
if(allRecords.find(".data/version") == allRecords.end() && allRecords.find("version") == allRecords.end()) {
std::string version = c10::to_string(version_);
std::string version = std::to_string(version_);
version.push_back('\n');
if (version_ >= 0x6L) {
writeRecord(".data/version", version.c_str(), version.size());

View File

@ -140,7 +140,7 @@ struct TensorQueue : torch::CustomClassHolder {
for (const auto index : c10::irange(queue_size)) {
at::Tensor val;
queue_[index] = dict.at(key + "/" + c10::to_string(index));
queue_[index] = dict.at(key + "/" + std::to_string(index));
queue_.push_back(val);
}
}
@ -152,7 +152,7 @@ struct TensorQueue : torch::CustomClassHolder {
dict.insert(
key + "/size", torch::tensor(static_cast<int64_t>(queue_.size())));
for (const auto index : c10::irange(queue_.size())) {
dict.insert(key + "/" + c10::to_string(index), queue_[index]);
dict.insert(key + "/" + std::to_string(index), queue_[index]);
}
return dict;
}