ClassyVision
ClassyVision copied to clipboard
Make models immutable for inference and pass state explicitly
Summary: Usual prediction setup assumes that there's a single instance of nn.Module (scripted) and it gets invoked from multiple threads concurrently to serve prediction requests. It means that the execution of the model can't modify the module itself.
ClassyVision used to save the intermediate block outputs in module attributes violating the above assumption. This diff tries to fix it by passing the block states explicitly.
Differential Revision: D19207155
This pull request was exported from Phabricator. Differential Revision: D19207155