Use test macros for IsInf tests.

Now that the tests are not disabled anymore, we can generate them with the
macros.

PiperOrigin-RevId: 351336136
Change-Id: Icd10d02185cb989bd8265a53d8e44a789f4d1ccc
This commit is contained in:
Adrian Kuegel 2021-01-12 03:20:36 -08:00 committed by TensorFlower Gardener
parent 8f0920289a
commit 9f14841393

View File

@ -254,33 +254,22 @@ GENERATE_DEFAULT_TEST(Imag, DT_COMPLEX128, DT_DOUBLE, baseline_imag,
test::GpuOpsTestConfig().AddTout().NoBufferReuse()) test::GpuOpsTestConfig().AddTout().NoBufferReuse())
/// Test `tf.IsInf`. /// Test `tf.IsInf`.
TEST_F(GpuUnaryOpTest, IsInfFloat) {
Test<float, float, bool, bool>(
/*op_name=*/"IsInf", test::DefaultInputShape(),
test::DefaultInput<float>(),
/*baseline_callback=*/std::isinf,
test::GpuOpsTestConfig().ExpectStrictlyEqual().NoBufferReuse());
}
TEST_F(GpuUnaryOpTest, IsInfDouble) { GENERATE_DEFAULT_TEST_2(
// Workaround for gcc bug, it would fail with "unresolved overloaded function IsInf, DT_FLOAT, DT_FLOAT, DT_BOOL, DT_BOOL, std::isinf,
// type" if passing std::isinf with type double. So we use type float for
// comparing expected values.
Test<double, float, bool, bool>(
/*op_name=*/"IsInf", test::DefaultInputShape(),
test::DefaultInput<double>(),
/*baseline_callback=*/std::isinf,
test::GpuOpsTestConfig().ExpectStrictlyEqual().NoBufferReuse()); test::GpuOpsTestConfig().ExpectStrictlyEqual().NoBufferReuse());
}
TEST_F(GpuUnaryOpTest, IsInfHalf) { // Workaround for gcc bug, it would fail with "unresolved overloaded function
Test<Eigen::half, float, bool, bool>( // type" if passing std::isinf with type double. So we use type float for
/*op_name=*/"IsInf", test::DefaultInputShape(), // comparing expected values.
test::DefaultInput<Eigen::half>(), GENERATE_DEFAULT_TEST_2(
/*baseline_callback=*/std::isinf, IsInf, DT_DOUBLE, DT_FLOAT, DT_BOOL, DT_BOOL, std::isinf,
test::GpuOpsTestConfig().ExpectStrictlyEqual().NoBufferReuse()); test::GpuOpsTestConfig().ExpectStrictlyEqual().NoBufferReuse());
}
// GENERATE_DEFAULT_TEST_2(
IsInf, DT_HALF, DT_FLOAT, DT_BOOL, DT_BOOL, std::isinf,
test::GpuOpsTestConfig().ExpectStrictlyEqual().NoBufferReuse());
/// Test `tf.Log`. /// Test `tf.Log`.
GENERATE_DEFAULT_TEST_WITH_SPECIFIC_INPUT_VALUES( GENERATE_DEFAULT_TEST_WITH_SPECIFIC_INPUT_VALUES(