Fix TensorReduction warnings and error bound for sum accuracy test.

The sum accuracy test currently uses the default test precision for the given scalar type. However, scalars are generated via a normal distribution, and given a large enough count and strong enough random generator, the expected sum is zero. This causes the test to periodically fail.

Here we estimate an upper-bound for the error as N * prec for summing N values, with each having an approximate epsilon of prec. In practice, this is much larger than it probably needs to be, since errors are generally both positive and negative.

Also fixed a few warnings generated by MSVC when compiling the reduction test.

Merge request reports

Loading