Enable torch tracing by changing assertions in d2go forwards to allow for...
Enable torch tracing by changing assertions in d2go forwards to allow for torch.fx.proxy.Proxy type. Summary: X-link: https://github.com/facebookresearch/detectron2/pull/4227 Pull Request resolved: https://github.com/facebookresearch/d2go/pull/241 Torch FX tracing propagates a type of `torch.fx.proxy.Proxy` through the graph. Existing type assertions in the d2go code base trigger during torch FX tracing, causing tracing to fail. This adds a check for FX tracing in progress and adds a helper function `assert_fx_safe()`, that can be used in place of a standard assertion. This function only applies the assertion if one is not tracing, allowing d2go assertion tests to be compatible with FX tracing. Reviewed By: wat3rBro Differential Revision: D35518556 fbshipit-source-id: a9b5d3d580518ca74948544973ae89f8b9de3282
Showing
Please register or sign in to comment