Cleanup C10::Scalar stringification (#73462)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73462
Because `operator<<` for Scalar is in `namespace at`, overload resolution fails very outside of `at`. Moving to `c10` fixes this because `namespace c10` will be included in the candidates due to the Scalar arg. I also didn't a good reason for the definition to be inline, and we're missing a `toString` overload so I added one.
Test Plan: Template deduction during compile should be sufficient.
Reviewed By: ezyang
Differential Revision: D34483818
fbshipit-source-id: 24007dde32db447046266c17517f62a2ac4b29cc
(cherry picked from commit 4076eba112a8aba2cf36d6636743a1db92108eeb)