diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-10-04 11:30:52 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-10-04 11:34:46 -0700 |
commit | 700c3325311e16be9bb4856cbf944d1871ff35c1 (patch) | |
tree | 9ae88328889950abaa951a628de7212caec8c026 /tensorflow/core/api_def | |
parent | c8d5054e8c12800f0c3db0e51f3d5902e04eaa37 (diff) |
Add "encoding" attribute to string substr op, which controls how each "character" is treated:
* BYTE: Position & length refer to bytes in the string. (Default)
* UTF8: The string is interpreted as UTF-8 encoded Unicode code points, and position & length are treated relative to them.
RELNOTES: Add option to get substring using Unicode characters
PiperOrigin-RevId: 215773373
Diffstat (limited to 'tensorflow/core/api_def')
-rw-r--r-- | tensorflow/core/api_def/base_api/api_def_Substr.pbtxt | 10 | ||||
-rw-r--r-- | tensorflow/core/api_def/python_api/api_def_Substr.pbtxt | 8 |
2 files changed, 11 insertions, 7 deletions
diff --git a/tensorflow/core/api_def/base_api/api_def_Substr.pbtxt b/tensorflow/core/api_def/base_api/api_def_Substr.pbtxt index 5246090ab3..fe0fcc9508 100644 --- a/tensorflow/core/api_def/base_api/api_def_Substr.pbtxt +++ b/tensorflow/core/api_def/base_api/api_def_Substr.pbtxt @@ -18,6 +18,16 @@ END Scalar defining the number of characters to include in each substring END } + attr { + name: "unit" + description: <<END +The unit that is used to create the substring. One of: `"BYTE"` (for +defining position and length by bytes) or `"UTF8_CHAR"` (for the UTF-8 +encoded Unicode code points). The default is `"BYTE"`. Results are undefined if +`unit=UTF8_CHAR` and the `input` strings do not contain structurally valid +UTF-8. +END + } out_arg { name: "output" description: <<END diff --git a/tensorflow/core/api_def/python_api/api_def_Substr.pbtxt b/tensorflow/core/api_def/python_api/api_def_Substr.pbtxt index 4778d7927c..4fb9ee56e9 100644 --- a/tensorflow/core/api_def/python_api/api_def_Substr.pbtxt +++ b/tensorflow/core/api_def/python_api/api_def_Substr.pbtxt @@ -1,10 +1,4 @@ op { graph_op_name: "Substr" - endpoint { - name: "strings.substr" - } - endpoint { - name: "substr" - deprecated: true - } + visibility: HIDDEN } |