Assigns unique names to the Network's outputs. Output layers with multiple output tensors would otherwise lead to duplicate names in self.output_names.
(self)
| 352 | self._feed_inputs.append(layer.input) |
| 353 | |
| 354 | def _set_output_names(self): |
| 355 | """Assigns unique names to the Network's outputs. |
| 356 | |
| 357 | Output layers with multiple output tensors would otherwise lead to duplicate |
| 358 | names in self.output_names. |
| 359 | """ |
| 360 | uniquified = [] |
| 361 | output_names = set() |
| 362 | prefix_count = {} |
| 363 | for layer in self._output_layers: |
| 364 | proposal = layer.name |
| 365 | while proposal in output_names: |
| 366 | existing_count = prefix_count.get(layer.name, 1) |
| 367 | proposal = '{}_{}'.format(layer.name, existing_count) |
| 368 | prefix_count[layer.name] = existing_count + 1 |
| 369 | output_names.add(proposal) |
| 370 | uniquified.append(proposal) |
| 371 | self.output_names = uniquified |
| 372 | |
| 373 | @trackable.no_automatic_dependency_tracking |
| 374 | def _init_subclassed_network(self, name=None, **kwargs): |
no test coverage detected