mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
[JIT] Fix compilation unit reference link in constant object upon load (#65784)
Summary: Follow up to https://github.com/pytorch/pytorch/pull/65442, make sure objects inserted into the graph from load do not holding owning reference. Pull Request resolved: https://github.com/pytorch/pytorch/pull/65784 Reviewed By: suo Differential Revision: D31251033 Pulled By: eellison fbshipit-source-id: 59efe19ce6f70744383de4eebf0f89f79f3eb03a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8130157504
commit
928a4bbafb
@ -525,6 +525,11 @@ void initJITBindings(PyObject* module) {
|
||||
[](std::shared_ptr<Graph>& g) { return ConstantPropagation(g); },
|
||||
py::arg("graph"))
|
||||
.def("_jit_pass_erase_shape_information", EraseShapeInformation)
|
||||
.def(
|
||||
"_jit_object_is_non_holding",
|
||||
[](Node& n) {
|
||||
return toIValue(n.output())->toObject()->is_weak_compilation_ref();
|
||||
})
|
||||
.def(
|
||||
"_jit_erase_non_input_shape_information",
|
||||
[](std::shared_ptr<Graph>& g) {
|
||||
|
Reference in New Issue
Block a user