Skip to content

Create tf.substr Op #4232

Description

@samjabrahams

Would be useful for a number of purposes, such as extracting data, substring matches (#4009), etc. Proposed API (matches C++ style substrings):

Args:
  inputs: a `Tensor` of type `string`. The strings that will have substrings extracted
  pos: `int32` or `int64` `Tensor`. Position of the first character to be copied as a substring
  len: `int32` or `int64` `Tensor`. Number of characters to include in the substring

Returns:
  A `Tensor` of type `string` containing substrings of `inputs`

Activity

  1. DjangoPeng commented on Sep 14, 2016

    @DjangoPeng
    Contributor

    @samjabrahams I want to try adding the substr Op :). Should I add it to the String_ops.py?

  2. samjabrahams commented on Sep 14, 2016

    @samjabrahams
    ContributorAuthor

    @DjangoPeng Oh no! I already sent in a PR two days ago with #4338. I'm planning on using the Op to finish work on the tf.decode_image Op, so I knocked out a version over the weekend.

  3. DjangoPeng commented on Sep 15, 2016

    @DjangoPeng
    Contributor

    @samjabrahams Sounds good~ Look forward to your update~

  4. samjabrahams commented on Nov 4, 2016

    @samjabrahams
    ContributorAuthor

    Substr (#4338) has been merged into master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions