Remove deprecated error handling symbols from v2
Also remove most uses of raise_exception_on_not_ok_status() PiperOrigin-RevId: 243348221
This commit is contained in:
parent
daea8481eb
commit
ea3f474c5f
@ -504,12 +504,12 @@ _EXCEPTION_CLASS_TO_CODE = {
|
||||
class_: code for code, class_ in _CODE_TO_EXCEPTION_CLASS.items()}
|
||||
|
||||
|
||||
@tf_export("errors.exception_type_from_error_code")
|
||||
@tf_export(v1=["errors.exception_type_from_error_code"])
|
||||
def exception_type_from_error_code(error_code):
|
||||
return _CODE_TO_EXCEPTION_CLASS[error_code]
|
||||
|
||||
|
||||
@tf_export("errors.error_code_from_exception_type")
|
||||
@tf_export(v1=["errors.error_code_from_exception_type"])
|
||||
def error_code_from_exception_type(cls):
|
||||
try:
|
||||
return _EXCEPTION_CLASS_TO_CODE[cls]
|
||||
@ -531,7 +531,7 @@ def _make_specific_exception(node_def, op, message, error_code):
|
||||
# @tf_contextlib.contextmanager version, which was switched to a class to avoid
|
||||
# some object creation overhead.
|
||||
# TODO(b/77295559): expand use of TF_Status* SWIG typemap and deprecate this.
|
||||
@tf_export("errors.raise_exception_on_not_ok_status") # pylint: disable=invalid-name
|
||||
@tf_export(v1=["errors.raise_exception_on_not_ok_status"]) # pylint: disable=invalid-name
|
||||
class raise_exception_on_not_ok_status(object):
|
||||
"""Context manager to check for C API status."""
|
||||
|
||||
|
@ -136,16 +136,4 @@ tf_module {
|
||||
name: "UnknownError"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member {
|
||||
name: "raise_exception_on_not_ok_status"
|
||||
mtype: "<type \'type\'>"
|
||||
}
|
||||
member_method {
|
||||
name: "error_code_from_exception_type"
|
||||
argspec: "args=[\'cls\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
member_method {
|
||||
name: "exception_type_from_error_code"
|
||||
argspec: "args=[\'error_code\'], varargs=None, keywords=None, defaults=None"
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +0,0 @@
|
||||
path: "tensorflow.errors.raise_exception_on_not_ok_status"
|
||||
tf_class {
|
||||
is_instance: "<class \'tensorflow.python.framework.errors_impl.raise_exception_on_not_ok_status\'>"
|
||||
is_instance: "<type \'object\'>"
|
||||
member_method {
|
||||
name: "__init__"
|
||||
}
|
||||
}
|
@ -781,6 +781,12 @@ class TFAPIChangeSpec(ast_edits.APIChangeSpec):
|
||||
"tf.compat.v1.debugging.assert_rank_at_least",
|
||||
"tf.debugging.assert_rank_in":
|
||||
"tf.compat.v1.debugging.assert_rank_in",
|
||||
"tf.errors.exception_type_from_error_code":
|
||||
"tf.compat.v1.errors.exception_type_from_error_code",
|
||||
"tf.errors.error_code_from_exception_type":
|
||||
"tf.compat.v1.errors.error_code_from_exception_type",
|
||||
"tf.errors.raise_exception_on_not_ok_status":
|
||||
"tf.compat.v1.errors.raise_exception_on_not_ok_status",
|
||||
"tf.assert_rank":
|
||||
"tf.compat.v1.assert_rank",
|
||||
"tf.nn.max_pool":
|
||||
|
Loading…
Reference in New Issue
Block a user