diff options
author | 2017-05-26 13:47:06 -0700 | |
---|---|---|
committer | 2017-05-26 13:52:23 -0700 | |
commit | d957f901e354ff526e05864fbbe5a14e9cfb2208 (patch) | |
tree | b229ce1b06a231659fbc30321b98411d02f2dee9 | |
parent | fccaac3d1bf1391756fae67f1979afe598d10ed1 (diff) |
Add more information to error message in contrib data function capturing.
Example error message now looks like:
ValueError: Cannot capture a stateful node (name:random_uniform, type:RandomUniformInt) by value.
PiperOrigin-RevId: 157258472
-rw-r--r-- | tensorflow/contrib/data/python/framework/function.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tensorflow/contrib/data/python/framework/function.py b/tensorflow/contrib/data/python/framework/function.py index 751beb7853..2839130ab7 100644 --- a/tensorflow/contrib/data/python/framework/function.py +++ b/tensorflow/contrib/data/python/framework/function.py @@ -86,9 +86,11 @@ class _ExperimentalFuncGraph(function._FuncGraph): def _add_op_and_parents(self, op): op_def = function._get_op_def(op) if op_def.is_stateful: - raise ValueError("Cannot capture a stateful node by value.") + raise ValueError("Cannot capture a stateful node (name:%s, type:%s) " + "by value." % (op.name, op.type)) elif op.type in ("Placeholder", "PlaceholderV2"): - raise ValueError("Cannot capture a placeholder by value.") + raise ValueError("Cannot capture a placeholder (name:%s, type:%s) " + "by value." % (op.name, op.type)) captured_inputs = [self._add_tensor_and_parents(x) for x in op.inputs] |