(self)
| 55 | |
| 56 | @test_util.run_deprecated_v1 |
| 57 | def testZeroFraction(self): |
| 58 | x_shape = [5, 17] |
| 59 | x_np = np.random.randint(0, 2, size=x_shape).astype(np.float32) |
| 60 | y_np = self._ZeroFraction(x_np) |
| 61 | |
| 62 | x_tf = constant_op.constant(x_np) |
| 63 | x_tf.set_shape(x_shape) |
| 64 | y_tf = nn_impl.zero_fraction(x_tf) |
| 65 | y_tf_np = self.evaluate(y_tf) |
| 66 | |
| 67 | eps = 1e-8 |
| 68 | self.assertAllClose(y_tf_np, y_np, eps) |
| 69 | |
| 70 | @test_util.run_deprecated_v1 |
| 71 | def testZeroFractionEmpty(self): |
nothing calls this directly
no test coverage detected