Beispiel #1
0
    .. code :: python

        # Example code in python
        raise InternalError("internal error detail")
    """
    def __init__(self, msg):
        # Patch up additional hint message.
        if "TVM hint:" not in msg:
            msg += (
                "\nTVM hint: You hit an internal error. " +
                "Please open a thread on https://discuss.tvm.apache.org/ to report it."
            )
        super(InternalError, self).__init__(msg)


register_error("ValueError", ValueError)
register_error("TypeError", TypeError)
register_error("AttributeError", AttributeError)
register_error("KeyError", KeyError)
register_error("IndexError", IndexError)


@register_error
class RPCError(TVMError):
    """Error thrown by the remote server handling the RPC call."""


@register_error
class OpError(TVMError):
    """Base class of all operator errors in frontends."""
Beispiel #2
0
    .. code :: python

        # Example code in python
        raise InternalError("internal error detail")
    """
    def __init__(self, msg):
        # Patch up additional hint message.
        if "TVM hint:" not in msg:
            msg += (
                "\nTVM hint: You hit an internal error. " +
                "Please open a thread on https://discuss.tvm.ai/ to report it."
            )
        super(InternalError, self).__init__(msg)


register_error("ValueError", ValueError)
register_error("TypeError", TypeError)
register_error("AttributeError", AttributeError)


@register_error
class OpError(TVMError):
    """Base class of all operator errors in frontends."""


@register_error
class OpNotImplemented(OpError, NotImplementedError):
    """Operator is not implemented.

    Example
    -------