def choose_max_and_accumulate(self, acc):
        """
        Find the maximum value along the given dimension, where 0 represents the
        leading dimension and 1 represents the non-leading dimension. If a target
        is not prvided, a new vector is created for storing the result.
        """

        m, n = self.shape

        err_code =  _cudamat.choose_max_and_accumulate(self.p_mat, acc.p_mat)
        if err_code:
            raise generate_exception(err_code)

        return acc

        Find the maximum value along the given dimension, where 0 represents the
        leading dimension and 1 represents the non-leading dimension. If a target
        is not prvided, a new vector is created for storing the result.
        
cudamat/cudamat.py