Move redundant code that checks NumPy during build to a helper module and add an option to disable building with NumPy
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/21417
Reviewed By: ezyang
Differential Revision: D15694357
Pulled By: fmassa
fbshipit-source-id: bc1bda23349ba4531f19619fa4adecb846225c20