diff options
Diffstat (limited to 'tensorflow/python/framework/errors.py')
-rw-r--r-- | tensorflow/python/framework/errors.py | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/tensorflow/python/framework/errors.py b/tensorflow/python/framework/errors.py index 68c656da85..92acc8f379 100644 --- a/tensorflow/python/framework/errors.py +++ b/tensorflow/python/framework/errors.py @@ -1,3 +1,18 @@ +# Copyright 2015 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== + """Exception types for TensorFlow errors.""" from __future__ import absolute_import from __future__ import division @@ -20,13 +35,13 @@ class OpError(Exception): """ def __init__(self, node_def, op, message, error_code): - """Creates a new OpError indicating that a particular op failed. + """Creates a new `OpError` indicating that a particular op failed. Args: - node_def: The graph_pb2.NodeDef proto representing the op that failed. - op: The ops.Operation that failed, if known; otherwise None. + node_def: The `graph_pb2.NodeDef` proto representing the op that failed. + op: The `ops.Operation` that failed, if known; otherwise None. message: The message string describing the failure. - error_code: The error_codes_pb2.Code describing the error. + error_code: The `error_codes_pb2.Code` describing the error. """ super(OpError, self).__init__() self._message = message @@ -45,10 +60,10 @@ class OpError(Exception): *N.B.* If the failed op was synthesized at runtime, e.g. a `Send` or `Recv` op, there will be no corresponding - [`Operation`](../../api_docs/python/framework.md#Operation) object. In that case, this - will return `None`, and you should instead use the - [`OpError.node_def`](#OpError.node_def) to discover information about the - op. + [`Operation`](../../api_docs/python/framework.md#Operation) + object. In that case, this will return `None`, and you should + instead use the [`OpError.node_def`](#OpError.node_def) to + discover information about the op. Returns: The `Operation` that failed, or None. |