Fix missing version < 2 guard in import (#24255)
Summary:
This was accidentally removed in #23241
Pull Request resolved: https://github.com/pytorch/pytorch/pull/24255
Pulled By: driazati
Differential Revision: D16788490
fbshipit-source-id: 9465570ade0299a845ec1b51cf88efe9c49b439b