We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a9eb48 commit 1083490Copy full SHA for 1083490
torch/csrc/autograd/python_function.cpp
@@ -559,14 +559,9 @@ static void _trace_post_record(
559
}
560
561
node->i_(jit::attr::inplace, is_inplace);
562
- if (node) {
563
- auto module_name = PyDict_GetItemString(((PyTypeObject*)op_obj)->tp_dict, "__module__");
564
- if (module_name) {
565
- const char *ptr = PyUnicode_AsUTF8(module_name);
566
- if (ptr) {
567
- auto modname = std::string(ptr);
568
- node->s_(jit::attr::module, modname);
569
- }
+ if (auto module_name = PyDict_GetItemString(((PyTypeObject*)op_obj)->tp_dict, "__module__")) {
+ if (auto ptr = PyUnicode_AsUTF8(module_name)) {
+ node->s_(jit::attr::module, std::string(ptr));
570
571
572
0 commit comments