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

Method testFloat

tensorflow/python/ops/math_ops_test.py:376–384  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

374
375 @test_util.run_deprecated_v1
376 def testFloat(self):
377 np.random.seed(12345)
378 for num_inputs in range(1, 10):
379 x = [np.random.random((1, 2, 3, 4, 5)) - 0.5 for _ in range(num_inputs)]
380 tf_x = ops.convert_n_to_tensor(x)
381 with self.cached_session(use_gpu=True):
382 self.assertAllClose(sum(x), math_ops.add_n(tf_x).eval())
383 self.assertAllClose(x[0] * num_inputs,
384 math_ops.add_n([tf_x[0]] * num_inputs).eval())
385
386 @test_util.run_deprecated_v1
387 def testInt(self):

Callers

nothing calls this directly

Calls 6

sumFunction · 0.85
rangeFunction · 0.70
seedMethod · 0.45
cached_sessionMethod · 0.45
assertAllCloseMethod · 0.45
evalMethod · 0.45

Tested by

no test coverage detected