def max(x):
    """Find maximal of array elements and corresponding indices along axis = 1
    Args:
        x: array-like
    Returns:
        max_vals_along_axis and max_indices_along_array
    """
    if len(x.shape) != 2:
        raise ValueError('The size of x shape must be 2 dimension')
    
    max_vals = x.max(1)
    max_inds = x.argmax(1)
    return max_vals, max_inds