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

Method testSum

tensorflow/python/data/kernel_tests/reduce_test.py:43–47  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

41class ReduceTest(test_base.DatasetTestBase, parameterized.TestCase):
42
43 def testSum(self):
44 for i in range(10):
45 ds = dataset_ops.Dataset.range(1, i + 1)
46 result = ds.reduce(np.int64(0), lambda x, y: x + y)
47 self.assertEqual(((i + 1) * i) // 2, self.evaluate(result))
48
49 def testSumTuple(self):
50

Callers

nothing calls this directly

Calls 4

rangeFunction · 0.50
rangeMethod · 0.45
reduceMethod · 0.45
evaluateMethod · 0.45

Tested by

no test coverage detected