[jit Python None should have its type inferred as NoneType (#26665)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/26665
This is actually useful. For example: in batchnorm.py, all the tracked
stats are either `nn.Parameter` or `None`. We should register them as
params if they are set, or attributes with type NoneType if they are
not.
Test Plan: Imported from OSS
Reviewed By: shannonzhu
Differential Revision: D17551197
Pulled By: suo
fbshipit-source-id: 8d6f6d76d4dab0d524c4ffdfe0c1dd465771cd00