function layer = globalAveragePooling1dLayer( NameValueArgs )
% globalAveragePooling1dLayer   1-D global average pooling layer
%
%   layer = globalAveragePooling1dLayer creates a global average pooling
%   layer that computes the mean over the length dimension of the 1-D
%   input.
%
%   layer = globalAveragePooling1dLayer('Name', name) additionally
%   specifies the layer name.
%
%   Example:
%       % Create a 1-D global average pooling layer.
%
%       layer = globalAveragePooling1dLayer;
%
%   See also nnet.cnn.layer.GlobalAveragePooling1DLayer,
%   averagePooling1dLayer, maxPooling1dLayer, globalMaxPooling1dLayer.
%
%   <a href="matlab:helpview('deeplearning','list_of_layers')">List of Deep Learning Layers</a>

%   Copyright 2021 The MathWorks, Inc.

arguments
    NameValueArgs.Name {iAssertValidLayerName} = ''
end

layer = nnet.cnn.layer.GlobalAveragePooling1DLayer(...
    nnet.internal.cnn.layer.GlobalAveragePooling1D(char(NameValueArgs.Name)));
end

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