• Yanghan Wang's avatar
    support lazy_func during bootstrap · 364be525
    Yanghan Wang authored
    Summary:
    Pull Request resolved: https://github.com/facebookresearch/d2go/pull/287
    
    In previous D36798327 (https://github.com/facebookresearch/d2go/commit/1f45cf04c69c63f51387b073ae931832b7a9510f), we still have 7 files which have exception during bootstrap. Instead of tweaking the the mock logic to support those scenarios, since they're all related to import-time computation, I think it's reasonable to "delay" those computations, therefore this diff introduces the `lazy_func` decorator, which delays it for bootstrap.
    
    After this change, now all files are be bootstrapped without exception, next step we'll change `catch_exception` to False and put a unit test on this to prevent committing code that is not bootstrap-able.
    
    Reviewed By: tglik
    
    Differential Revision: D36814147
    
    fbshipit-source-id: e344a5ccee76b1d9962117d300926a88c066e051
    364be525
modeldef.py 16.9 KB