(self, inputs, training=None, mask=None)
| 249 | self.built = True |
| 250 | |
| 251 | def call(self, inputs, training=None, mask=None): # pylint: disable=redefined-outer-name |
| 252 | if self._is_graph_network: |
| 253 | if not self.built: |
| 254 | self._init_graph_network(self.inputs, self.outputs, name=self.name) |
| 255 | return super(Sequential, self).call(inputs, training=training, mask=mask) |
| 256 | |
| 257 | outputs = inputs # handle the corner case where self.layers is empty |
| 258 | for layer in self.layers: |
| 259 | # During each iteration, `inputs` are the inputs to `layer`, and `outputs` |
| 260 | # are the outputs of `layer` applied to `inputs`. At the end of each |
| 261 | # iteration `inputs` is set to `outputs` to prepare for the next layer. |
| 262 | kwargs = {} |
| 263 | argspec = self._layer_call_argspecs[layer].args |
| 264 | if 'mask' in argspec: |
| 265 | kwargs['mask'] = mask |
| 266 | if 'training' in argspec: |
| 267 | kwargs['training'] = training |
| 268 | |
| 269 | outputs = layer(inputs, **kwargs) |
| 270 | |
| 271 | # `outputs` will be the inputs to the next layer. |
| 272 | inputs = outputs |
| 273 | mask = outputs._keras_mask |
| 274 | |
| 275 | return outputs |
| 276 | |
| 277 | def compute_output_shape(self, input_shape): |
| 278 | shape = input_shape |
no test coverage detected