[PyTorch] Move is_nested_tensor_impl & add get_nested_tensor_impl_or_null (#73928)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73928
Making these functions accessible for reuse.
ghstack-source-id: 150816078
Test Plan: CI
Reviewed By: ezyang
Differential Revision: D34647898
fbshipit-source-id: 69e944526b22f10f94d37c44f3a08e3e1717e23e
(cherry picked from commit 6b8d588d825925f32500dc172dc537cb5148dcc0)