diff options
Diffstat (limited to 'tensorflow/python/framework/test_util.py')
-rw-r--r-- | tensorflow/python/framework/test_util.py | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tensorflow/python/framework/test_util.py b/tensorflow/python/framework/test_util.py index e645d772e9..c8a6fcacbc 100644 --- a/tensorflow/python/framework/test_util.py +++ b/tensorflow/python/framework/test_util.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. +# ============================================================================== + # pylint: disable=invalid-name """Test utils for tensorflow.""" from __future__ import absolute_import @@ -62,16 +77,16 @@ class TensorFlowTestCase(googletest.TestCase): def _AssertProtoEquals(self, a, b): """Asserts that a and b are the same proto. - Uses Proto2Cmp() first, as it returns correct results - for floating point attributes, and then use assertProto2Equal() + Uses ProtoEq() first, as it returns correct results + for floating point attributes, and then use assertProtoEqual() in case of failure as it provides good error messages. Args: a: a proto. b: another proto. """ - if compare.Proto2Cmp(a, b) != 0: - compare.assertProto2Equal(self, a, b, normalize_numbers=True) + if not compare.ProtoEq(a, b): + compare.assertProtoEqual(self, a, b, normalize_numbers=True) def assertProtoEquals(self, expected_message_maybe_ascii, message): """Asserts that message is same as parsed expected_message_ascii. |