[LTC] Upstream some utilities (#69046)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69046
This commit upstreams utilities including ExceptionCleanup, MaybeRef,
Iota, ToVector, ToOptionalVector and GetEnumValue.
Test Plan: ./build/bin/test_lazy --gtest_filter=UtilTest.*
Reviewed By: wconstab, Chillee
Differential Revision: D32709090
Pulled By: alanwaketan
fbshipit-source-id: 5147433becd4dbb07be7d36d66b0b8685054d714