self.assertAllEqual(2.0, m2.result())
def testNamesWithSpaces(self):
- # Verify two metrics with the same class and name don't
- # accidentally share state.
m1 = metrics.Mean("has space")
m1(0)
self.assertEqual(m1.name, "has space")
self.assertEqual(self.evaluate(value), 2.5)
def testTwoMeansGraph(self):
- # Verify two metrics with the same class and name don't
- # accidentally share state.
+ # Verify two metrics with the same name in the same graph raises a
+ # ValueError.
with context.graph_mode():
m1 = metrics.Mean()
m1(0)