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

Method testCall

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

Source from the content-addressed store, hash-verified

70
71 @test_util.run_in_graph_and_eager_modes(assert_no_eager_garbage=True)
72 def testCall(self):
73 dense = core_layers.Dense(2, activation=nn_ops.relu, name='my_dense')
74 inputs = random_ops.random_uniform((5, 4), seed=1)
75 outputs = dense(inputs)
76 self.assertListEqual([5, 2], outputs.get_shape().as_list())
77 self.assertListEqual(dense.variables, [dense.kernel, dense.bias])
78 self.assertListEqual(dense.trainable_variables,
79 [dense.kernel, dense.bias])
80 self.assertListEqual(dense.non_trainable_variables, [])
81 if not context.executing_eagerly():
82 self.assertEqual(
83 len(ops.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)), 2)
84 self.assertEqual(dense.kernel.name, 'my_dense/kernel:0')
85 self.assertEqual(dense.bias.name, 'my_dense/bias:0')
86
87 @test_util.assert_no_new_pyobjects_executing_eagerly
88 def testNoEagerLeak(self):

Callers

nothing calls this directly

Calls 6

denseFunction · 0.85
random_uniformMethod · 0.80
executing_eagerlyMethod · 0.80
as_listMethod · 0.45
get_shapeMethod · 0.45
get_collectionMethod · 0.45

Tested by

no test coverage detected