Add string_strip to remove leading and trailing whitespaces (#18418)
authorYong Tang <yong.tang.github@outlook.com>
Wed, 18 Apr 2018 20:49:18 +0000 (13:49 -0700)
committerDerek Murray <derek.murray@gmail.com>
Wed, 18 Apr 2018 20:49:18 +0000 (13:49 -0700)
commit075fbb59d767ae2868c369799d553a953ffb4dad
tree890a374e3484115bde165f8987f6c2eb237bca55
parent6e87115add98695862343539f383bf82e5cacf32
Add string_strip to remove leading and trailing whitespaces (#18418)

* Add string_strip to remove leading and trailing whitespaces

This fix tries to address the issue raised in 18384 to add
an op tf.string_strip so that the leading and trailing whitespaces
could be removed.

This fix fixes 18384.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Add StringStrip op to string_ops.cc

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Update Bazel BUILD file

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Sanitize with clang-format

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Add test cases for string_strip

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Fix pylint issue

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Update API defs with tensorflow/core/api_def/update_api_def.sh

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Fix python test error

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Update goldens API with

```
bazel-bin/tensorflow/tools/api/tests/api_compatibility_test
           --update_goldens True
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
tensorflow/core/api_def/base_api/api_def_StringStrip.pbtxt [new file with mode: 0644]
tensorflow/core/kernels/BUILD
tensorflow/core/kernels/string_strip_op.cc [new file with mode: 0644]
tensorflow/core/ops/string_ops.cc
tensorflow/python/kernel_tests/BUILD
tensorflow/python/kernel_tests/string_strip_op_test.py [new file with mode: 0644]
tensorflow/tools/api/golden/tensorflow.pbtxt