(self)
| 178 | |
| 179 | @test_util.run_in_graph_and_eager_modes |
| 180 | def testCall(self): |
| 181 | |
| 182 | class MyLayer(base_layers.Layer): |
| 183 | |
| 184 | def call(self, inputs): |
| 185 | return math_ops.square(inputs) |
| 186 | |
| 187 | layer = MyLayer(name='my_layer') |
| 188 | inputs = random_ops.random_uniform((5,), seed=1) |
| 189 | outputs = layer.apply(inputs) |
| 190 | self.assertEqual(layer.built, True) |
| 191 | if not context.executing_eagerly(): |
| 192 | # op is only supported in GRAPH mode |
| 193 | self.assertEqual(outputs.op.name, 'my_layer/Square') |
| 194 | |
| 195 | @test_util.run_in_graph_and_eager_modes |
| 196 | def testDeepCopy(self): |
nothing calls this directly
no test coverage detected