function A=squeeze_sum(A,dims)
% squeeze_sum - Squeeze out first N dimensions by summing
%
% squeeze_sum :: [Size], K:natural -> [Size1] :- Size1=Size(K+1:end).
%
% Defined as squeeze_sum(A,K)=shiftdim(sumdims(A,1:K),K)
if ~isempty(dims),
	for i=dims, A=sum(A,i); end
	A=squeeze(A);
end
