diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-09-25 11:56:33 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-09-25 12:07:36 -0700 |
commit | d5c5df164cedcd8ae43fff41256592818bc6c2de (patch) | |
tree | 0b07685ff599ad9bfe93a58386c67adb94e57c8e /tensorflow/core/api_def | |
parent | df930015230c1195065e2fd01c61f527b8662efb (diff) |
Add "encoding" attribute to string length op, which controls how "string length" is defined:
* BYTE: The number of bytes in each string. (Default)
* UTF8: The number of UTF-8 encoded Unicode code points in each string.
RELNOTES: Add option to calculate string length in Unicode characters
PiperOrigin-RevId: 214478470
Diffstat (limited to 'tensorflow/core/api_def')
-rw-r--r-- | tensorflow/core/api_def/base_api/api_def_StringLength.pbtxt | 10 | ||||
-rw-r--r-- | tensorflow/core/api_def/python_api/api_def_StringLength.pbtxt | 4 |
2 files changed, 11 insertions, 3 deletions
diff --git a/tensorflow/core/api_def/base_api/api_def_StringLength.pbtxt b/tensorflow/core/api_def/base_api/api_def_StringLength.pbtxt index cc21ddc815..7d2fbcd00b 100644 --- a/tensorflow/core/api_def/base_api/api_def_StringLength.pbtxt +++ b/tensorflow/core/api_def/base_api/api_def_StringLength.pbtxt @@ -1,5 +1,15 @@ op { graph_op_name: "StringLength" + attr { + name: "unit" + description: <<END +The unit that is counted to compute string length. One of: `"BYTE"` (for +the number of bytes in each string) or `"UTF8_CHAR"` (for the number of UTF-8 +encoded Unicode code points in each string). Results are undefined +if `unit=UTF8_CHAR` and the `input` strings do not contain structurally +valid UTF-8. +END + } in_arg { name: "input" description: <<END diff --git a/tensorflow/core/api_def/python_api/api_def_StringLength.pbtxt b/tensorflow/core/api_def/python_api/api_def_StringLength.pbtxt index 01c02e1f70..df012414e3 100644 --- a/tensorflow/core/api_def/python_api/api_def_StringLength.pbtxt +++ b/tensorflow/core/api_def/python_api/api_def_StringLength.pbtxt @@ -1,6 +1,4 @@ op { graph_op_name: "StringLength" - endpoint { - name: "strings.length" - } + visibility: HIDDEN } |