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

Method testNoBias

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

Source from the content-addressed store, hash-verified

101
102 @test_util.run_in_graph_and_eager_modes
103 def testNoBias(self):
104 dense = core_layers.Dense(2, use_bias=False, name='my_dense')
105 inputs = random_ops.random_uniform((5, 2), seed=1)
106 _ = dense(inputs)
107 self.assertListEqual(dense.variables, [dense.kernel])
108 self.assertListEqual(dense.trainable_variables, [dense.kernel])
109 self.assertListEqual(dense.non_trainable_variables, [])
110 if not context.executing_eagerly():
111 self.assertEqual(
112 len(ops.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)), 1)
113 self.assertEqual(dense.kernel.name, 'my_dense/kernel:0')
114 self.assertEqual(dense.bias, None)
115
116 @test_util.run_in_graph_and_eager_modes
117 def testNonTrainable(self):

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected