diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2016-11-09 12:04:36 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-11-09 12:22:07 -0800 |
commit | f86d96d2b2e1765b8bcd3aabef09d22181f9b573 (patch) | |
tree | 6850fbc91f1123ee6f80d8918c972dbd736314d3 /tensorflow/python/framework/common_shapes.py | |
parent | a66ecabe9ae1bae41bd044c6b478c33b1c4d8733 (diff) |
Fix call_cpp_shape_fn's option for comparing to python (needs to convert result
from proto TensorShape before comparison).
Change: 138668146
Diffstat (limited to 'tensorflow/python/framework/common_shapes.py')
-rw-r--r-- | tensorflow/python/framework/common_shapes.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tensorflow/python/framework/common_shapes.py b/tensorflow/python/framework/common_shapes.py index c8867b4b1b..3e56ee5eca 100644 --- a/tensorflow/python/framework/common_shapes.py +++ b/tensorflow/python/framework/common_shapes.py @@ -636,12 +636,13 @@ def call_cpp_shape_fn(op, except Exception as err: raise AssertionError("Python shape function return error but " "C++ shape functon did not: %s" % str(err)) - if str(result) != str(python_result): + result_as_shapes = [tensor_shape.as_shape(s) for s in result] + if str(result_as_shapes) != str(python_result): raise ValueError( ("Python vs CPP shape mismatch. " "CPP: %s vs python: %s on node %s " "with input shapes %s") % ( - str(result), str(python_result), str(op.node_def), + str(result_as_shapes), str(python_result), str(op.node_def), ",".join([str(i.get_shape()) for i in op.inputs]))) return {"shapes": result, |