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

Method testEagerExecution

tensorflow/python/layers/core_test.py:290–305  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

288 np.zeros((2)))
289
290 def testEagerExecution(self):
291 with context.eager_mode():
292 container = variable_scope.EagerVariableStore()
293 x = constant_op.constant([[2.0]])
294 with container.as_default():
295 y = core_layers.dense(
296 x, 1, name='my_dense',
297 kernel_initializer=init_ops.ones_initializer())
298 self.assertAllEqual(y, [[2.0]])
299 self.assertEqual(len(container.variables()), 2)
300 # Recreate the layer to test reuse.
301 with container.as_default():
302 core_layers.dense(
303 x, 1, name='my_dense',
304 kernel_initializer=init_ops.ones_initializer())
305 self.assertEqual(len(container.variables()), 2)
306
307 def testFunctionalDenseWithCustomGetter(self):
308 called = [0]

Callers

nothing calls this directly

Calls 4

as_defaultMethod · 0.95
variablesMethod · 0.95
constantMethod · 0.45
assertAllEqualMethod · 0.45

Tested by

no test coverage detected