Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash of tf.strings.substr when pos and len have different shapes #46974

Merged

Conversation

yongtang
Copy link
Member

@yongtang yongtang commented Feb 6, 2021

This PR tries to address the issue raised in #46900 where
tf.strings.substr will crash when pos and len have different shapes.
According to the documentation of tf.strings.substr, ValueError
should be raised instead when pos and len does not have the same shape.

This PR add shape check in kernel to allows grace error throw (instead of crash).

This PR fixes #46900.

Signed-off-by: Yong Tang yong.tang.github@outlook.com

This PR tries to address the issue raised in 46900 where
tf.strings.substr will crash when pos and len have different shapes.
According to the documentation of tf.strings.substr, ValueError
should be raised instead when pos and len does not have the same shape.

This PR add shape check in kernel to allows grace error throw (instead of crash).

This PR fixes 46900.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@google-ml-butler google-ml-butler bot added the size:S CL Change Size: Small label Feb 6, 2021
@google-cla google-cla bot added the cla: yes label Feb 6, 2021
@gbaned gbaned self-assigned this Feb 7, 2021
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Feb 7, 2021
PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Feb 8, 2021
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Feb 8, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Feb 8, 2021
@gbaned gbaned added the prtype:bugfix PR to fix a bug label Feb 9, 2021
@copybara-service copybara-service bot merged commit 890f716 into tensorflow:master Feb 9, 2021
PR Queue automation moved this from Approved by Reviewer to Merged Feb 9, 2021
@yongtang yongtang deleted the 46900-tf.strings.substr branch February 9, 2021 17:47
geetachavan1 added a commit to geetachavan1/tensorflow that referenced this pull request May 19, 2021
geetachavan1 added a commit to geetachavan1/tensorflow that referenced this pull request May 19, 2021
geetachavan1 added a commit to geetachavan1/tensorflow that referenced this pull request May 19, 2021
geetachavan1 added a commit to geetachavan1/tensorflow that referenced this pull request May 19, 2021
mihaimaruseac added a commit that referenced this pull request May 19, 2021
CherryPick:2.1:PR #46974: Fix crash of tf.strings.substr when pos and len have different shapes
mihaimaruseac added a commit that referenced this pull request May 19, 2021
CherryPick:2.2:PR #46974: Fix crash of tf.strings.substr when pos and len have different shapes
mihaimaruseac added a commit that referenced this pull request May 19, 2021
CherryPick:2.3:PR #46974: Fix crash of tf.strings.substr when pos and len have different shapes
mihaimaruseac added a commit that referenced this pull request May 19, 2021
CherryPick:2.4:PR #46974: Fix crash of tf.strings.substr when pos and len have different shapes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes prtype:bugfix PR to fix a bug ready to pull PR ready for merge process size:S CL Change Size: Small
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

tf.strings.substr crashes(aborts)
4 participants