Eliminate c10::stoi,c10::stod,c10::stoull,c10::stoll (#109179)

We can remove these functions in favor of std ones.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/109179
Approved by: https://github.com/colesbury
This commit is contained in:
cyy
2023-09-16 07:22:50 +00:00
committed by PyTorch MergeBot
parent 393fe9339a
commit 852f1b8417
20 changed files with 35 additions and 138 deletions

View File

@ -292,7 +292,7 @@ static const std::vector<OperatorGeneratorArgs> opGenArgs{
auto s = pop(stack).toString();
// NOLINTNEXTLINE(cppcoreguidelines-init-variables)
std::string::size_type sz;
int64_t val = static_cast<int64_t>(c10::stoll(s->string(), &sz));
int64_t val = static_cast<int64_t>(std::stoll(s->string(), &sz));
if (sz == s->string().size()) {
push(stack, val);
} else {
@ -349,7 +349,7 @@ static const std::vector<OperatorGeneratorArgs> opGenArgs{
auto s = pop(stack).toString();
// NOLINTNEXTLINE(cppcoreguidelines-init-variables)
std::string::size_type sz;
double b = c10::stod(s->string(), &sz);
double b = std::stod(s->string(), &sz);
if (sz == s->string().size()) {
push(stack, b);
} else {