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

Method testMean

tensorflow/contrib/eager/python/metrics_test.py:43–50  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

41class MetricsTest(test.TestCase):
42
43 def testMean(self):
44 m = metrics.Mean()
45 m([1, 10, 100])
46 m(1000)
47 m([10000.0, 100000.0])
48 self.assertEqual(111111.0/6, m.result().numpy())
49 self.assertEqual(dtypes.float64, m.dtype)
50 self.assertEqual(dtypes.float64, m.result().dtype)
51
52 def testVariableCollections(self):
53 with context.graph_mode(), ops.Graph().as_default():

Callers

nothing calls this directly

Calls 3

resultMethod · 0.95
MeanMethod · 0.45
numpyMethod · 0.45

Tested by

no test coverage detected