function layer = globalMaxPooling2dLayer( NameValueArgs )
% globalMaxPooling2dLayer   2-D global max pooling layer
%
%   layer = globalMaxPooling2dLayer creates a global max pooling layer that
%   outputs the maximum value over the height and width dimensions of the
%   2-D input.
%
%   layer = globalMaxPooling2dLayer('Name', name) additionally
%   specifies the layer name.
%
%   Example:
%       % Create a 2-D global max pooling layer.
%
%       layer = globalMaxPooling2dLayer;
%
%   See also nnet.cnn.layer.GlobalMaxPooling2DLayer,
%   maxPooling2dLayer, averagePooling2dLayer, globalMaxPooling3dLayer.
%
%   <a href="matlab:helpview('deeplearning','list_of_layers')">List of Deep Learning Layers</a>

%   Copyright 2019-2021 The MathWorks, Inc.

arguments
    NameValueArgs.Name {iAssertValidLayerName} = ''
end

layer = nnet.cnn.layer.GlobalMaxPooling2DLayer(...
    nnet.internal.cnn.layer.GlobalMaxPooling2D(char(NameValueArgs.Name)));
end

function iAssertValidLayerName(name)
nnet.internal.cnn.layer.paramvalidation.validateLayerName(name);
end
