<gh_stars>0
def norm(x, ord=None, axis=None):
    # TODO(beam2d): Implement it
    raise NotImplementedError


def cond(x, p=None):
    # TODO(beam2d): Implement it
    raise NotImplementedError


def det(a):
    # TODO(beam2d): Implement it
    raise NotImplementedError


def matrix_rank(M, tol=None):
    # TODO(beam2d): Implement it
    raise NotImplementedError


def slogdet(a):
    # TODO(beam2d): Implement it
    raise NotImplementedError


def trace(a, offset=0, axis1=0, axis2=1, dtype=None, out=None):
    """Returns the sum along the diagonals of an array.

    It computes the sum along the diagonals at ``axis1`` and ``axis2``.

    Args:
        a (cupy.ndarray): Array to take trace.
        offset (int): Index of diagonals. Zero indicates the main diagonal, a
            positive value an upper diagonal, and a negative value a lower
            diagonal.
        axis1 (int): The first axis along which the trace is taken.
        axis2 (int): The second axis along which the trace is taken.
        dtype: Data type specifier of the output.
        out (cupy.ndarray): Output array.

    Returns:
        cupy.ndarray: The trace of ``a`` along axes ``(axis1, axis2)``.

    .. seealso:: :func:`numpy.trace`

    """
    d = a.diagonal(offset, axis1, axis2)
    return d.sum(-1, dtype, out, False)

def norm(x, ord=None, axis=None):
    # TODO(beam2d): Implement it
    raise NotImplementedError


def cond(x, p=None):
    # TODO(beam2d): Implement it
    raise NotImplementedError


def det(a):
    # TODO(beam2d): Implement it
    raise NotImplementedError


def matrix_rank(M, tol=None):
    # TODO(beam2d): Implement it
    raise NotImplementedError


def slogdet(a):
    # TODO(beam2d): Implement it
    raise NotImplementedError


def trace(a, offset=0, axis1=0, axis2=1, dtype=None, out=None):
    """Returns the sum along the diagonals of an array.

    It computes the sum along the diagonals at ``axis1`` and ``axis2``.

    Args:
        a (cupy.ndarray): Array to take trace.
        offset (int): Index of diagonals. Zero indicates the main diagonal, a
            positive value an upper diagonal, and a negative value a lower
            diagonal.
        axis1 (int): The first axis along which the trace is taken.
        axis2 (int): The second axis along which the trace is taken.
        dtype: Data type specifier of the output.
        out (cupy.ndarray): Output array.

    Returns:
        cupy.ndarray: The trace of ``a`` along axes ``(axis1, axis2)``.

    .. seealso:: :func:`numpy.trace`

    """
    d = a.diagonal(offset, axis1, axis2)
    return d.sum(-1, dtype, out, False)
# TODO(beam2d): Implement it # TODO(beam2d): Implement it # TODO(beam2d): Implement it # TODO(beam2d): Implement it # TODO(beam2d): Implement it Returns the sum along the diagonals of an array.      It computes the sum along the diagonals at ``axis1`` and ``axis2``.      Args:         a (cupy.ndarray): Array to take trace.         offset (int): Index of diagonals. Zero indicates the main diagonal, a             positive value an upper diagonal, and a negative value a lower             diagonal.         axis1 (int): The first axis along which the trace is taken.         axis2 (int): The second axis along which the trace is taken.         dtype: Data type specifier of the output.         out (cupy.ndarray): Output array.      Returns:         cupy.ndarray: The trace of ``a`` along axes ``(axis1, axis2)``.      .. seealso:: :func:`numpy.trace`