(self)
| 188 | |
| 189 | @test_util.run_in_graph_and_eager_modes |
| 190 | def testRounding(self): |
| 191 | x = np.arange(-5.0, 5.0, .25) |
| 192 | for dtype in [np.float32, np.double, np.int32]: |
| 193 | x_np = np.array(x, dtype=dtype) |
| 194 | with test_util.device(use_gpu=True): |
| 195 | x_tf = constant_op.constant(x_np, shape=x_np.shape) |
| 196 | y_tf = math_ops.round(x_tf) |
| 197 | y_tf_np = self.evaluate(y_tf) |
| 198 | y_np = np.round(x_np) |
| 199 | self.assertAllClose(y_tf_np, y_np, atol=1e-2) |
| 200 | |
| 201 | |
| 202 | class ModTest(test_util.TensorFlowTestCase): |
nothing calls this directly
no test coverage detected