pytorch/test/cpp
Yidi Wu b22f0f5f51 [torchbind] fix bug of mutating FakeScriptObjects twice in aot_export (#128844)
This PR does two things:
1. it duplicates the fake script object because aot_export trace the program twice. The result of tracing in the first time would cause the tracing result of second time be wrong.
2. Also add a new test for methods that return constant outputs. Before the PR, there's is no meta["val"] for these nodes because fx won't track these constants. We still need to preserve these constant return operators in the graph because torchbind objects are stateful and deleting it would remove the implicit state mutation inside of the object.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/128844
Approved by: https://github.com/angelayi
2024-06-24 23:14:34 +00:00
..
aoti_abi_check
aoti_inference
api
c10d
common
dist_autograd
jit [torchbind] fix bug of mutating FakeScriptObjects twice in aot_export (#128844) 2024-06-24 23:14:34 +00:00
lazy Remove unused functions (#127881) 2024-06-05 05:21:24 +00:00
lite_interpreter_runtime
monitor
profiler
rpc
tensorexpr Check unused variables in tests (#127498) 2024-06-04 05:35:25 +00:00
__init__.py