aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/api_def
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-09-12 16:03:42 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-12 16:10:59 -0700
commit565ce4142d184cf8ead88a993f3a0ffe61d0b809 (patch)
treec3cb645b4ddbdafc2b9563fb5cadfea69b7b0b9c /tensorflow/core/api_def
parent2f1f2679dfb4175270defd3ddf176ee8fa9e8c41 (diff)
Support passing a negative position to substr. If the position is negative, the start of the substring will be counted backwards from the end of the string.
RELNOTES: Support negative positions for tf.substr PiperOrigin-RevId: 212720335
Diffstat (limited to 'tensorflow/core/api_def')
-rw-r--r--tensorflow/core/api_def/base_api/api_def_Substr.pbtxt6
1 files changed, 4 insertions, 2 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 8fc1e5cba3..5246090ab3 100644
--- a/tensorflow/core/api_def/base_api/api_def_Substr.pbtxt
+++ b/tensorflow/core/api_def/base_api/api_def_Substr.pbtxt
@@ -32,8 +32,10 @@ For each string in the input `Tensor`, creates a substring starting at index
If `len` defines a substring that would extend beyond the length of the input
string, then as many characters as possible are used.
-If `pos` is negative or specifies a character index larger than any of the input
-strings, then an `InvalidArgumentError` is thrown.
+A negative `pos` indicates distance within the string backwards from the end.
+
+If `pos` specifies an index which is out of range for any of the input strings,
+then an `InvalidArgumentError` is thrown.
`pos` and `len` must have the same shape, otherwise a `ValueError` is thrown on
Op creation.