Make ContainerHash compatible with const& types (#66497)
Summary:
- this change should not impact existing use cases, but allows for
additional use cases where the container holds const types.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/66497
Reviewed By: alanwaketan
Differential Revision: D31582242
Pulled By: wconstab
fbshipit-source-id: 3a0e18b4afaf3c7ff93a0e3d09067ed066402b44