定义TensorFlow错误的异常类型
2018-09-08 16:49 更新
#版权所有2015 TensorFlow作者.版权所有.
#
#根据Apache许可证版本2.0(“许可证”)许可;
#除非符合许可证,否则您不得使用此文件.
#您可以获得许可证的副本
#
#http://www.apache.org/licenses/LICENSE-2.0
#
#除非适用法律要求或书面同意软件
根据许可证分发的#分发在“按原样”基础上,
#无明示或暗示的任何种类的保证或条件.
#查看有关权限的特定语言的许可证
#许可证下的限制.
# =============================================== =============================
"" TensorFlow错误的异常类型.""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: disable=unused-import
from tensorflow.python.framework import errors_impl as _impl
# pylint: enable=unused-import
# go/tf-wildcard-import
# pylint: disable=wildcard-import
from tensorflow.python.framework.errors_impl import *
# pylint: enable=wildcard-import
from tensorflow.python.util.all_util import remove_undocumented
# These are referenced in client/client_lib.py.
# Unfortunately, we can't import client_lib to examine
# the references, since it would create a dependency cycle.
_allowed_symbols = [
"AbortedError",
"AlreadyExistsError",
"CancelledError",
"DataLossError",
"DeadlineExceededError",
"FailedPreconditionError",
"InternalError",
"InvalidArgumentError",
"NotFoundError",
"OpError",
"OutOfRangeError",
"PermissionDeniedError",
"ResourceExhaustedError",
"UnauthenticatedError",
"UnavailableError",
"UnimplementedError",
"UnknownError",
"error_code_from_exception_type",
"exception_type_from_error_code",
"raise_exception_on_not_ok_status",
# Scalars that have no docstrings:
"OK",
"CANCELLED",
"UNKNOWN",
"INVALID_ARGUMENT",
"DEADLINE_EXCEEDED",
"NOT_FOUND",
"ALREADY_EXISTS",
"PERMISSION_DENIED",
"UNAUTHENTICATED",
"RESOURCE_EXHAUSTED",
"FAILED_PRECONDITION",
"ABORTED",
"OUT_OF_RANGE",
"UNIMPLEMENTED",
"INTERNAL",
"UNAVAILABLE",
"DATA_LOSS",
]
remove_undocumented(__name__, _allowed_symbols)
以上内容是否对您有帮助:
更多建议: