function X = pagetranspose(X)
%PAGETRANSPOSE Page-wise transpose on each page of gpuArray.
%   
%   Y = PAGETRANSPOSE(X) applies the non-conjugate transpose to each page of N-D array X:
%      Y(:,:,i) = X(:,:,i).'
%   
%   This is equivalent to calling permute(X,[2 1 3:ndims(X)]).
%   


%   Copyright 2020 The MathWorks, Inc.

if ismatrix(X)
    X = transpose(X);
    return
end

X = pagefun(@transpose, X);

end 