Fix boxing/unboxing for Scalar bool values (#53228)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/53228
Previously, if a Scalar value contained a bool and was put into and then out of an IValue, it would magically transform to an int.
This PR fixes that and preserves the bool-ness.
ghstack-source-id: 125886985
(Note: this ignores all push blocking failures!)
Test Plan: unit tests
Reviewed By: ezyang
Differential Revision: D26800346
fbshipit-source-id: f170a5b8419bde9d3155042f9126e377714ec3ba