Fix cached state bug in ToOutVarPass (#1333)
Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/1333 The Executorch pass `ToOutVarPass` had a bug that only occurred when calling `to_executorch` on two different models: the missing out vars from model A would be accidentally remembered and thrown again for model B incorrectly. While this probably requires a more general fix to the PassRegistry and to the ExecutorchBackendConfig to use a factory instead of a singleton, for now this is easy to fix for this one issue by not using an instance, and instead keep it local to each `call`. Other passes might want to check their `ensures` implementation. Reviewed By: larryliu0820 Differential Revision: D51771381 fbshipit-source-id: b25f57c5743723143bbb436c9dfb4f2daf330014
R
Riley Dulin committed
d96c49e878defa7cccf976b30ae67bc7b20f531a
Parent: 47b44b4
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 12/1/2023, 11:27:11 PM