def extract_layers_by_str(model, layers):
    """
    Returns references to layers from model by name

    Parameters
    ----------
    model : torch.nn.Module
        model where layers should be extracted from
    layers : iterable of str
        iterable which contains the names of the respective layers

    Returns
    -------
    list
        list with references to specified layers
    """
    def extract_layer_Torch(model, layer):
        """
        Extract a reference to single layer from model

        Parameters
        ----------
        model : torch.nn.Module
            model where layers should be extracted from
        layer : str
            name of respective layer

        Returns
        -------
        nn.Module
            reference to layer
        """
        submod = model
        if '.' in layer:
            # split actual layer name and 'path' to layer
            prefix, name = layer.rsplit('.', 1)

            # extract layer
            for l in prefix.split('.'):
                submod = getattr(submod, l)
        else:
            name = layer
        return getattr(submod, name)

    return [extract_layer_Torch(model, l) for l in layers]