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

Checks for integer overflow in function tf.convert_to_tensor() ----> #58996

Closed

Conversation

Sarvesh-Kesharwani
Copy link

@Sarvesh-Kesharwani Sarvesh-Kesharwani commented Dec 24, 2022

i added a conditional check if input value to "tf.convert_to_tensor(a, tf.int32)" is not exceeding int32 limit, if dtype is int32.

closes issue #58994

@google-ml-butler google-ml-butler bot added the size:S CL Change Size: Small label Dec 24, 2022
@Sarvesh-Kesharwani Sarvesh-Kesharwani changed the title Closes issue #58994 Closes issue https://github.com/tensorflow/tensorflow/issues/58994 Dec 24, 2022
@Sarvesh-Kesharwani Sarvesh-Kesharwani changed the title Closes issue https://github.com/tensorflow/tensorflow/issues/58994 Closes issue Dec 24, 2022
@Sarvesh-Kesharwani Sarvesh-Kesharwani changed the title Closes issue Closes issue #58994---- Dec 24, 2022
@Sarvesh-Kesharwani Sarvesh-Kesharwani changed the title Closes issue #58994---- Checks for integer overflow in function tf.convert_to_tensor() ----> Dec 24, 2022
@Sarvesh-Kesharwani
Copy link
Author

guys please guide me further as this is my first PR.
i'll be grateful for your support. thankyou

@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Dec 26, 2022
@gbaned gbaned added the prtype:bugfix PR to fix a bug label Dec 26, 2022
@gbaned gbaned requested a review from JXRiver December 26, 2022 10:53
@google-ml-butler google-ml-butler bot added the awaiting review Pull request awaiting review label Dec 26, 2022
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.

I think the overflow fixes have to be in C++, not in Python

@Sarvesh-Kesharwani
Copy link
Author

hi, mihaimaruseac
thanx for replying, i was stuck findivg what i am doing wrong.
i guess i will be able to make some progress now.
thanx

@edwardyehuang
Copy link
Contributor

edwardyehuang commented Dec 30, 2022

I think the overflow fixes have to be in C++, not in Python

Agree. The example below is also dangerous.

import tensorflow as tf

a = 2147483647
a = tf.convert_to_tensor(a, tf.int32)

print(a) # tf.Tensor(2147483647, shape=(), dtype=int32)

b = a + tf.constant(1, tf.int32)

print(b) # tf.Tensor(-2147483648, shape=(), dtype=int32)

@gbaned
Copy link
Contributor

gbaned commented Mar 21, 2023

@Sarvesh-Kesharwani Can you please resolve conflicts? Thank you!

@gbaned gbaned added stat:awaiting response Status - Awaiting response from author and removed awaiting review Pull request awaiting review labels Mar 21, 2023
@Sarvesh-Kesharwani
Copy link
Author

@Sarvesh-Kesharwani Can you please resolve conflicts? Thank you!

sure

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Status - Awaiting response from author label Mar 21, 2023
@mihaimaruseac
Copy link
Collaborator

This PR is now just adding a single empty line

@Sarvesh-Kesharwani
Copy link
Author

This PR is now just adding a single empty line

I regret to inform you that I am currently unable to dedicate enough time to familiarize myself with the required code base for this PR. As a result, I will have to close this PR.

PR Queue automation moved this from Assigned Reviewer to Closed/Rejected Mar 22, 2023
@google-ml-butler google-ml-butler bot removed the awaiting review Pull request awaiting review label Mar 22, 2023
@tensorflow tensorflow locked as spam and limited conversation to collaborators Mar 22, 2023
@mihaimaruseac mihaimaruseac added the invalid Hacktoberfest spam PR label Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid Hacktoberfest spam PR prtype:bugfix PR to fix a bug size:S CL Change Size: Small
Projects
PR Queue
  
Closed/Rejected
Development

Successfully merging this pull request may close these issues.

None yet

4 participants