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

Method testKeepDims

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

Source from the content-addressed store, hash-verified

133
134 @test_util.run_deprecated_v1
135 def testKeepDims(self):
136 for dtype in [np.float16, np.float32, np.double]:
137 x_np = np.random.rand(5, 5).astype(dtype)
138 with self.cached_session(use_gpu=True):
139 y_tf_np = math_ops.reduce_logsumexp(x_np, keepdims=True).eval()
140 self.assertEqual(y_tf_np.ndim, x_np.ndim)
141 y_np = log(np.sum(exp(x_np), keepdims=True))
142 self.assertAllClose(y_tf_np, y_np)
143
144 @test_util.run_deprecated_v1
145 def testOverflow(self):

Callers

nothing calls this directly

Calls 7

randMethod · 0.80
logFunction · 0.50
expFunction · 0.50
cached_sessionMethod · 0.45
evalMethod · 0.45
sumMethod · 0.45
assertAllCloseMethod · 0.45

Tested by

no test coverage detected