(self)
| 115 | |
| 116 | @test_util.run_in_graph_and_eager_modes |
| 117 | def testNonTrainable(self): |
| 118 | dense = core_layers.Dense(2, trainable=False, name='my_dense') |
| 119 | inputs = random_ops.random_uniform((5, 2), seed=1) |
| 120 | _ = dense(inputs) |
| 121 | self.assertListEqual(dense.variables, [dense.kernel, dense.bias]) |
| 122 | self.assertListEqual(dense.non_trainable_variables, |
| 123 | [dense.kernel, dense.bias]) |
| 124 | self.assertListEqual(dense.trainable_variables, []) |
| 125 | if not context.executing_eagerly(): |
| 126 | self.assertEqual( |
| 127 | len(ops.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)), 0) |
| 128 | |
| 129 | @test_util.run_in_graph_and_eager_modes |
| 130 | def testOutputShape(self): |
nothing calls this directly
no test coverage detected