%% Check Validity of Layer Using checkLayer
% Check the layer validity of the custom layer residualBlockLayer using the checkLayer function.
% Create an instance of a residual block layer. To access this layer, open this example as a live script.

numFilters = 64;

layer = residualBlockLayer(numFilters)

% Check the layer validity using the checkLayer function. The layer expects 4-D array inputs, where the first three dimensions correspond to the height, width, and number of channels of the previous layer output, and the fourth dimension corresponds to the observations. Specify a typical input size and set the 'ObservationDimension' option to 4.

validInputSize = [56 56 64];
checkLayer(layer,validInputSize,'ObservationDimension',4)

% The function does not detect any issues with the layer.
% Copyright 2021 The MathWorks, Inc.