maximum/minimum along dims