Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion torch/csrc/jit/passes/python_print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,16 @@ TORCH_API bool printerHasSpecialCaseFor(Symbol sym) {

};

return handled.count(sym) || unneeded.count(sym);
// These namespaces are required to have Python printers unless
// otherwise noted in unneeded.
const static std::unordered_set<Symbol> required_namespaces = {
c10::namespaces::prim,
c10::namespaces::aten,
c10::namespaces::onnx,
};

return handled.count(sym) || unneeded.count(sym) ||
!required_namespaces.count(sym.ns());
}

} // namespace jit
Expand Down