def _get_custom_layer_names(spec):
    """

    Returns a list of ``className`` fields which appear in the given protobuf spec.

    Parameters
    ----------
    spec: mlmodel spec

    Returns
    -------
    set(str)
        A set of unique ``className`` fields of custom layers that appear in the model.

    """
    layers = _get_nn_layers(spec)
    layers_out = set()
    for layer in layers:
        if layer.WhichOneof("layer") == "custom":
            layers_out.add(layer.custom.className)

    return layers_out


    Returns a list of ``className`` fields which appear in the given protobuf spec.

    Parameters
    ----------
    spec: mlmodel spec

    Returns
    -------
    set(str)
        A set of unique ``className`` fields of custom layers that appear in the model.

    
coremltools/models/utils.py