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

%   Copyright 2019-2021 The MathWorks, Inc.

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

% Ensure logicals are cast to single
X = nnet.internal.cnnhost.castToSuperiorFloat(X);

X = nnet.internal.cnnhost.softmaxForward(X, channelDim);

end

