  
          Returns
          -------
          :class:`collections.OrderedDict`
              The layer name as key with the inbound node layer names for each layer as value.
          """
          retval = OrderedDict()
          for layer in self._config["layers"]:
              name = layer["name"]
              if not layer["inbound_nodes"]:
 
</s> remove         Input layers to the full model are not returned in the structure.
 </s> add         This parses the model config (in reverse) to obtain the required layers for an inference
        model. </s> remove         retval = OrderedDict()
        for layer in self._config["layers"]:
            name = layer["name"]
            if not layer["inbound_nodes"]:
                logger.debug("Skipping input layer: '%s'", name)
                continue
            inbound = self._filter_node(layer["inbound_nodes"])

            # TODO Currently any models which have a list input will not contain the main model
            # input. This may not be true in future (if the main input is injected into a layer
            # further down the model chain) so this should be made more robust
            if (not any(isinstance(inb, list) for inb in inbound)
                    and self._input_names.intersection(inbound)):
                # Strip the input inbound nodes for applying the correct input layer at compile
                # time
                logger.debug("Stripping inbound nodes for input '%s': %s", name, inbound)
                inbound = ""

            if inbound and np.array(layer["inbound_nodes"]).shape[0] == 2:
                # if inbound is not populated, then layer is already split at input
                logger.debug("Filtering layer with split inbound nodes: '%s': %s", name, inbound)
                inbound = inbound[self._output_idx]
                inbound = inbound if isinstance(inbound, list) else [inbound]
                logger.debug("Filtered inbound nodes for layer '%s': %s", name, inbound)
            if name in self._outputs_dropout:
                logger.debug("Dropping output layer '%s'", name)
                continue
            retval[name] = inbound
        logger.debug("Model structure: %s", retval)
        return retval
 </s> add         # Filter output layer
        out = np.array(self._config["output_layers"], dtype="object")
        if out.ndim == 2:
            out = np.expand_dims(out, axis=1)  # Needs to be expanded for _get_nodes
        outputs = self._get_nodes(out)

        # Iterate backwards from the required output to get the reversed model structure
        current_layers = [outputs[0]]
        next_layers = []
        struct = OrderedDict()
        drop_input = self._input_names[abs(self._input_idx - 1)]
        switch_input = self._input_names[self._input_idx]
        while True:
            layer_info = current_layers.pop(0)
            current_layer = next(lyr for lyr in self._config["layers"]
                                 if lyr["name"] == layer_info[0])
            inbound = current_layer["inbound_nodes"] </s> remove         input_split = len(inputs) // 2
        start_idx = input_split * input_index
        retval = inputs[start_idx: start_idx + input_split]
        logger.debug("model inputs: %s, input_split: %s, start_idx: %s, inference_inputs: %s",
                     inputs, input_split, start_idx, retval)
        return retval

    def _get_outputs_dropout(self):
        """ Obtain the output layer names from the full model that will not be used for inference.

        Returns
        -------
        set
            The output layer names from the saved Faceswap model that are not used for inference
            for the requested swap direction
        """
        outputs = self._config["output_layers"]
        if get_backend() == "amd":
            outputs = [outputs[:len(outputs) // 2], outputs[len(outputs) // 2:]]

        output_names = self._filter_node(outputs)
        if not all(isinstance(name, list) for name in output_names):
            output_names = [[name] for name in output_names]
        side_outputs = set(output_names[self._output_idx])
        logger.debug("model outputs: %s, output_names: %s, side_outputs: %s",
                     outputs, output_names, side_outputs)

        outputs_all = {layer
                       for side in output_names
                       for layer in side}
        retval = outputs_all.difference(side_outputs)
        logger.debug("outputs dropout: %s", retval)
 </s> add         nodes = np.array(nodes, dtype="object")[..., :3]
        num_layers = nodes.shape[0]
        nodes = nodes[self._output_idx] if num_layers == 2 else nodes[0]
        retval = [(node[0], node[2]) for node in nodes] </s> remove             A squeezed list with only the layer name entries remaining
        """
        retval = np.array(node)[..., 0].squeeze().tolist()
        return retval if isinstance(retval, list) else [retval]

    @classmethod
    def _get_inputs(cls, inputs, input_index):
        """ Obtain the inputs for the requested swap direction.

        Parameters
        ----------
        inputs: list
            The full list of input tensors to the saved faceswap training model
        input_index: int
            The input index for the requested swap direction

        Returns
        -------
        list
            List of input tensors to feed the model for the requested swap direction
 </s> add             The (node name, output index) for each node passed in </s> remove         for name, inbound in struct.items():
            if name not in required_layers:
                logger.debug("Skipping unused layer: '%s'", name)
 </s> add         for layer in saved_model.layers:
            if layer.name not in struct:
                logger.debug("Skipping unused layer: '%s'", layer.name)
            The layer name as key with the input name and output index as value.
  
          Returns
          -------
          :class:`collections.OrderedDict`
            The layer name as key with the input name and output index as value.
          """
          retval = OrderedDict()
          for layer in self._config["layers"]:
              name = layer["name"]
              if not layer["inbound_nodes"]:
keep keep keep keep replace keep keep keep keep keep
 plugins.train.model.base - More robust inference model generation 
plugins/train/model/_base.py