function [PlaceholderLayers, Indices] = findPlaceholderLayers(Layers)
%findPlaceholderLayers    Find placeholder layers in a LayerGraph, a Layer
%array or a dlnetwork
% 
%   PlaceholderLayers = findPlaceholderLayers(Layers) returns an
%   array of all placeholder layers found in Layers. Placeholder
%   layers are instances of the PlaceholderLayer object that one 
%   of the following function inserts in place of unsupported 
%   operators or layers:  importONNXLayers, importKerasLayer,
%   importTensorFlowLayers, importTensorFlowNetwork, 
%   importNetworkFromONNX, importNetworkFromTensorFlow or
%   functionToLayerGraph.
%
%   [PlaceholderLayers, Indices] = findPlaceholderLayers(__) also returns
%   the indices of the placeholder layers as a numeric array.
% 
%   Example - Import Keras Network Layers And Find Placeholder Layers
%   -----------------------------------------------------------------
%
%   importedLayers = importKerasLayers('digitsDAGnetwithnoise.h5')
%   [placeholderLayers, indices] = findPlaceholderLayers(importedLayers)
%
%   See also functionToLayerGraph, importONNXLayers, importKerasLayers,
%   importTensorFlowNetwork, importTensorFlowLayers,
%   importNetworkFromTensorFlow, importNetworkFromONNX

% Copyright 2019-2022 The Mathworks, Inc.

narginchk(1,1);
validateattributes(Layers,{'nnet.cnn.LayerGraph','nnet.cnn.layer.Layer', 'dlnetwork'},{})
[PlaceholderLayers, Indices] = nnet.internal.cnn.util.findPlaceholderLayers(Layers);
end
