function X = internal_gelu(X, approx)
% This function is undocumented and will change in a future release.

%   Copyright 2022 The MathWorks, Inc.

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

switch approx
    case "none"
        X = nnet.internal.cnngpu.geluForwardM(X);
    case "tanh"
        X = nnet.internal.cnngpu.geluForwardTanhApproximationM(X);
end
end