mirror of
https://github.com/zebrajr/tensorflow.git
synced 2025-12-07 12:20:24 +01:00
Add a test for negative and zero pow() input.
PiperOrigin-RevId: 165650096
This commit is contained in:
parent
a3c4e980e0
commit
8c0853db73
|
|
@ -785,6 +785,17 @@ XLA_TEST_F(ArrayElementwiseOpTest, PowF32s) {
|
||||||
&builder, {16.0f, 0.25f, 8.0f, NAN, NAN, -8.0f, 16.0f}, {}, error_spec_);
|
&builder, {16.0f, 0.25f, 8.0f, NAN, NAN, -8.0f, 16.0f}, {}, error_spec_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XLA_TEST_F(ArrayElementwiseOpTest, PowNonIntegerF32s) {
|
||||||
|
SetFastMathDisabled(true);
|
||||||
|
ComputationBuilder builder(client_, TestName());
|
||||||
|
auto lhs = builder.ConstantR1<float>({-2.0f, -0.6f, -0.6f, 0.0f});
|
||||||
|
auto rhs = builder.ConstantR1<float>({0.5f, 0.6f, -0.6f, -0.6f});
|
||||||
|
auto minimum = builder.Pow(lhs, rhs);
|
||||||
|
|
||||||
|
ComputeAndCompareR1<float>(&builder, {NAN, NAN, NAN, INFINITY}, {},
|
||||||
|
error_spec_);
|
||||||
|
}
|
||||||
|
|
||||||
XLA_TEST_F(ArrayElementwiseOpTest, PowZeroElementF32s) {
|
XLA_TEST_F(ArrayElementwiseOpTest, PowZeroElementF32s) {
|
||||||
ComputationBuilder builder(client_, TestName());
|
ComputationBuilder builder(client_, TestName());
|
||||||
auto lhs = builder.ConstantR1<float>({});
|
auto lhs = builder.ConstantR1<float>({});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user