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

Method testInt

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

Source from the content-addressed store, hash-verified

385
386 @test_util.run_deprecated_v1
387 def testInt(self):
388 np.random.seed(54321)
389 for num_inputs in range(1, 10):
390 x = [
391 np.random.randint(-128, 128, (5, 4, 3, 2, 1))
392 for _ in range(num_inputs)
393 ]
394 tf_x = ops.convert_n_to_tensor(x)
395 with self.cached_session(use_gpu=True):
396 self.assertAllEqual(sum(x), math_ops.add_n(tf_x).eval())
397 self.assertAllEqual(x[0] * num_inputs,
398 math_ops.add_n([tf_x[0]] * num_inputs).eval())
399
400 @test_util.run_deprecated_v1
401 def testGrad(self):

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected