mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[1/N] Deprecate c10::string_view and at::string (#151972)
The calls of `c10::string_view` in the code base are replaced by `std::string_view`. The calls of `at::string` are replaced by `std::string` Pull Request resolved: https://github.com/pytorch/pytorch/pull/151972 Approved by: https://github.com/malfet
This commit is contained in:
@ -63,8 +63,7 @@ void flatten_rec(PyObject* obj, ParsedArgs& args) {
|
||||
structure.push_back(D::DictClose);
|
||||
Py_DECREF(dict_items);
|
||||
} else if (THPUtils_checkString(obj)) {
|
||||
string str = THPUtils_unpackString(obj);
|
||||
args.desc.strings.emplace_back(str);
|
||||
args.desc.strings.emplace_back(THPUtils_unpackString(obj));
|
||||
args.desc.structure.push_back(D::String);
|
||||
} else if (THPVariable_Check(obj)) {
|
||||
auto& var = THPVariable_Unpack(obj);
|
||||
@ -142,8 +141,8 @@ py::object unflatten_rec(
|
||||
ArrayRef<Variable>::iterator& var_it,
|
||||
ArrayRef<Variable>::iterator& var_it_end,
|
||||
std::string::const_iterator& desc_it,
|
||||
std::vector<string>::const_iterator& str_it,
|
||||
std::vector<string>::const_iterator& str_it_end) {
|
||||
std::vector<std::string>::const_iterator& str_it,
|
||||
std::vector<std::string>::const_iterator& str_it_end) {
|
||||
char type = *desc_it++;
|
||||
if (type == D::TupleOpen) {
|
||||
std::vector<py::object> objs;
|
||||
|
Reference in New Issue
Block a user