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

[Go] Perform validation on slices when converting Go values to tensors #52257

Merged
merged 2 commits into from Oct 8, 2021

Conversation

wamuir
Copy link
Contributor

@wamuir wamuir commented Oct 5, 2021

PR adds some validation in NewTensor such that it errors prior to building a tensor in the case of dimension mismatch. 960121c has the side effect of reintroducing the segfaults addressed by #50508, but the approach taken in this latter PR is no longer viable.

@google-ml-butler google-ml-butler bot added the size:S CL Change Size: Small label Oct 5, 2021
@google-ml-butler google-ml-butler bot added the awaiting review Pull request awaiting review label Oct 5, 2021
@google-cla google-cla bot added the cla: yes label Oct 5, 2021
@wamuir wamuir changed the title [Go] Perform validation on slices when building new tensors [Go] Perform validation on slices when converting Go values to tensors Oct 5, 2021
@gbaned gbaned self-assigned this Oct 5, 2021
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Oct 5, 2021
Copy link
Collaborator

@mihaimaruseac mihaimaruseac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM but can we also add a unit test that would result in segfault if this gets reverted/broken again?

PR Queue automation moved this from Assigned Reviewer to Reviewer Requested Changes Oct 5, 2021
@wamuir
Copy link
Contributor Author

wamuir commented Oct 7, 2021

This LGTM but can we also add a unit test that would result in segfault if this gets reverted/broken again?

@mihaimaruseac please take a look. This seems to be very effective and test takes about 500ms here. Probably this could be replaced by some smarter / less brute approach at a later time.

@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Oct 7, 2021
PR Queue automation moved this from Reviewer Requested Changes to Approved by Reviewer Oct 7, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Oct 7, 2021
@gbaned gbaned removed the awaiting review Pull request awaiting review label Oct 8, 2021
@copybara-service copybara-service bot merged commit c36d5a1 into tensorflow:master Oct 8, 2021
@google-ml-butler google-ml-butler bot removed the ready to pull PR ready for merge process label Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes size:S CL Change Size: Small
Projects
PR Queue
  
Approved by Reviewer
Development

Successfully merging this pull request may close these issues.

None yet

4 participants