[Reland] Elimates c10::guts::to_string (#108748)

Reland of PR #108480, after relanding another blocking PR.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/108748
Approved by: https://github.com/huydhn
This commit is contained in:
cyy
2023-09-07 13:35:17 +00:00
committed by PyTorch MergeBot
parent c887309437
commit e4f3e5434f
45 changed files with 185 additions and 242 deletions

View File

@ -182,8 +182,7 @@ TEST(OptimTest, OptimizerAccessors) {
// test for state() with non-const reference return
auto& state_ = static_cast<AdagradParamState&>(
*(optimizer
.state()[c10::guts::to_string(params_1[0].unsafeGetTensorImpl())]));
*(optimizer.state()[params_1[0].unsafeGetTensorImpl()]));
state_.step(state_.step() + 1);
const auto& optimizer_ = Adagrad(params, options);