MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / testZeroFraction

Method testZeroFraction

tensorflow/python/ops/nn_test.py:57–68  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 5

_ZeroFractionMethod · 0.95
constantMethod · 0.45
set_shapeMethod · 0.45
evaluateMethod · 0.45
assertAllCloseMethod · 0.45

Tested by

no test coverage detected