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

Method _ZeroFraction

tensorflow/python/ops/nn_test.py:50–54  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

48class ZeroFractionTest(test_lib.TestCase):
49
50 def _ZeroFraction(self, x):
51 assert x.shape
52 total_elements = np.prod(x.shape)
53 nonzeros = np.count_nonzero(x.flatten())
54 return 1.0 - nonzeros / total_elements
55
56 @test_util.run_deprecated_v1
57 def testZeroFraction(self):

Callers 1

testZeroFractionMethod · 0.95

Calls 1

flattenMethod · 0.45

Tested by

no test coverage detected