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:
parent
8f0920289a
commit
9f14841393
@ -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
|
test::GpuOpsTestConfig().ExpectStrictlyEqual().NoBufferReuse());
|
||||||
// comparing expected values.
|
|
||||||
Test<double, float, bool, bool>(
|
// Workaround for gcc bug, it would fail with "unresolved overloaded function
|
||||||
/*op_name=*/"IsInf", test::DefaultInputShape(),
|
// type" if passing std::isinf with type double. So we use type float for
|
||||||
test::DefaultInput<double>(),
|
// comparing expected values.
|
||||||
/*baseline_callback=*/std::isinf,
|
GENERATE_DEFAULT_TEST_2(
|
||||||
test::GpuOpsTestConfig().ExpectStrictlyEqual().NoBufferReuse());
|
IsInf, DT_DOUBLE, DT_FLOAT, DT_BOOL, DT_BOOL, std::isinf,
|
||||||
}
|
test::GpuOpsTestConfig().ExpectStrictlyEqual().NoBufferReuse());
|
||||||
|
|
||||||
|
GENERATE_DEFAULT_TEST_2(
|
||||||
|
IsInf, DT_HALF, DT_FLOAT, DT_BOOL, DT_BOOL, std::isinf,
|
||||||
|
test::GpuOpsTestConfig().ExpectStrictlyEqual().NoBufferReuse());
|
||||||
|
|
||||||
TEST_F(GpuUnaryOpTest, IsInfHalf) {
|
|
||||||
Test<Eigen::half, float, bool, bool>(
|
|
||||||
/*op_name=*/"IsInf", test::DefaultInputShape(),
|
|
||||||
test::DefaultInput<Eigen::half>(),
|
|
||||||
/*baseline_callback=*/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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user