function [X, XMean, XInvStd] = internal_layernorm(X, offset, scale, epsilon, dimension, ~)
% This function is undocumented and will change in a future release.

%   Copyright 2020-2022 The MathWorks, Inc.

% gpuArray method for internal_layernorm. The help for this method is
% similar to the CPU method internal_layernorm

if ~isreal(X) || ~isreal(offset) || ~isreal(scale)
    error(message('deep:dlarray:ComplexNotSupported'))
end

% Call the cnnhost forward method since no ad-hoc GPU implementation is
% yet available
[X, XMean, XInvStd] = nnet.internal.cnnhost.layerNormalizationForward(X,offset,scale,epsilon,dimension);

end
