Relax Scalar::toXXX conversions to only check for overflow

Currently, the toXXX functions on Scalar check that the conversions are
exact. This will cause an exception in code like:

  auto t = CPU(kFloat).ones({1});
  t *= M_PI;

Or the equivalent in Python:

  t = torch.ones(1)
  t *= math.pi

This changes the checks to only throw an exception in the case of
overflow (positive or negative).
4 files changed