Defer constructing error strings for definitions under If's until they're needed. (#21429)
Summary:
This saves ~7% DenseNet load time (4.3s -> 4.0s) on my laptop.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21429
Differential Revision: D15681374
fbshipit-source-id: 9925a6154d51f2d592e26cb5ff8bf7ab3ee2519b