diff options
author | Skye Wanderman-Milne <skyewm@google.com> | 2018-04-02 14:40:37 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-04-02 14:42:57 -0700 |
commit | 817882c28fd6f0dbbbf35b6ac0764ccbd38430d0 (patch) | |
tree | a149aaef047c19a4687c6a8b43012451dc9d0614 /tensorflow/python/client | |
parent | e0488c7f4ee1d3d996c6e87076f4683a41883fd3 (diff) |
ResourceHandleShapeAndType returns bytes, not unicode.
This could cause failures when enabling the C API with python3.
PiperOrigin-RevId: 191350031
Diffstat (limited to 'tensorflow/python/client')
-rw-r--r-- | tensorflow/python/client/tf_session.i | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tensorflow/python/client/tf_session.i b/tensorflow/python/client/tf_session.i index 5dcd0c192e..ee76e29c05 100644 --- a/tensorflow/python/client/tf_session.i +++ b/tensorflow/python/client/tf_session.i @@ -460,6 +460,11 @@ TF_ImportGraphDefResultsMissingUnusedInputMappings_wrapper{ $1 = PyLong_AsLongLong($input); } +// Override default py3 behavior of attempting to encode into Unicode. +%typemap(out) std::string tensorflow::ResourceHandleShapeAndType { + $result = PyBytes_FromStringAndSize($1.data(), $1.size()); +} + // TODO(skyewm): SWIG emits a warning for the const char* in TF_WhileParams, // skip for now %ignore TF_WhileParams; |