zero initialize some members and other fixes (#59915)

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/59915

Reviewed By: soulitzer

Differential Revision: D29106684

Pulled By: ezyang

fbshipit-source-id: 713cbdf10866017ee715ee89ec82acb592c769b6
This commit is contained in:
cyy
2021-07-19 07:34:38 -07:00
committed by Facebook GitHub Bot
parent 0263865bfe
commit a26a9f8b75
4 changed files with 3 additions and 5 deletions

View File

@ -108,7 +108,7 @@ static PyObject * THPModule_initNames(PyObject *self, PyObject *arg)
THPUtils_assert(THPUtils_checkString(module_name.get()),
"expected __module__ to be a string");
std::string name = THPUtils_unpackString(module_name.get());
names.push_back(name + "." + type->tp_name);
names.emplace_back(name + "." + type->tp_name);
type->tp_name = names.back().c_str();
}
Py_RETURN_NONE;