Replace four make_offset_calculator functions with one (#35551)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/35551
Test Plan: Imported from OSS
Differential Revision: D20703649
Pulled By: pbelevich
fbshipit-source-id: 7ab13107dc630de63b3dee776697a96439ffb033