| 39 | using ops::Unstack; |
| 40 | |
| 41 | TEST(GradientCheckerTest, BasicFloat) { |
| 42 | Scope scope = Scope::NewRootScope(); |
| 43 | TensorShape shape({2, 4, 3}); |
| 44 | auto x = Placeholder(scope, DT_FLOAT, Placeholder::Shape(shape)); |
| 45 | auto y = Square(scope, x); |
| 46 | float max_error; |
| 47 | TF_ASSERT_OK((ComputeGradientError<float, float, float>( |
| 48 | scope, {x}, {shape}, {y}, {shape}, &max_error))); |
| 49 | EXPECT_LT(max_error, 1e-4); |
| 50 | } |
| 51 | |
| 52 | TEST(GradientCheckerTest, BasicDouble) { |
| 53 | Scope scope = Scope::NewRootScope(); |
nothing calls this directly
no test coverage detected