function layer = globalAveragePooling3dLayer( varargin )
% globalAveragePooling3dLayer   3-D global average pooling layer
%
%   layer = globalAveragePooling3dLayer creates a global average pooling
%   layer that computes the mean over the height, width and depth dimension
%   of the 3-D input.
%
%   layer = globalAveragePooling3dLayer('Name', name) additionally
%   specifies the layer name.
%
%   Example:
%       % Create a 3-D global average pooling layer.
%
%       layer = globalAveragePooling3dLayer;
%
%   See also nnet.cnn.layer.GlobalAveragePooling3DLayer,
%   averagePooling3dLayer, maxPooling3dLayer, globalAveragePooling2dLayer.
%
%   <a href="matlab:helpview('deeplearning','list_of_layers')">List of Deep Learning Layers</a>

%   Copyright 2019 The MathWorks, Inc.

p = inputParser;
addParameter(p, 'Name', '', @iAssertValidLayerName);
p.parse(varargin{:});

layer = nnet.cnn.layer.GlobalAveragePooling3DLayer(...
    nnet.internal.cnn.layer.GlobalAveragePooling3D(char(p.Results.Name)));
end

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