diff --git a/tensorflow/python/framework/tensor_util.py b/tensorflow/python/framework/tensor_util.py index 968b635250a..3d5a16dd0f6 100644 --- a/tensorflow/python/framework/tensor_util.py +++ b/tensorflow/python/framework/tensor_util.py @@ -525,7 +525,7 @@ def make_tensor_proto(values, dtype=None, shape=None, verify_shape=False, if nparray.size * nparray.itemsize >= (1 << 31): raise ValueError( "Cannot create a tensor proto whose content is larger than 2GB.") - tensor_proto.tensor_content = nparray.tostring() + tensor_proto.tensor_content = nparray.tobytes() return tensor_proto # If we were not given values as a numpy array, compute the proto_values diff --git a/tensorflow/python/kernel_tests/decode_raw_op_test.py b/tensorflow/python/kernel_tests/decode_raw_op_test.py index ae8d40dbaea..5ed6689e48a 100644 --- a/tensorflow/python/kernel_tests/decode_raw_op_test.py +++ b/tensorflow/python/kernel_tests/decode_raw_op_test.py @@ -84,22 +84,22 @@ class DecodeRawOpTest(test.TestCase): def testToFloat16(self): result = np.matrix([[1, -2, -3, 4]], dtype="