TensorFlow is an open source platform for machine learning. In affected versions while calculating the size of the output within the `tf.range` kernel, there is a conditional statement of type `int64 = condition ? int64 : double`. Due to C++ implicit conversion rules, both branches of the condition will be cast to `double` and the result would be truncated before the assignment. This result in overflows. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4, as these are also affected and still in supported range.
cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*
0E596567-6F67-4880-8EC4-CB262BF02E0D
2.4.4
2.4.0
cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*
035CDF63-1548-4FB4-B8A9-B8D328FAF910
2.5.2
2.5.0
cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*
5D68D8D1-DB27-4395-9D3D-2BED901B852C
2.6.1
2.6.0
cpe:2.3:a:google:tensorflow:2.7.0:rc0:*:*:*:*:*:*
A58EDA5C-66D6-46F1-962E-60AFB7C784A7
cpe:2.3:a:google:tensorflow:2.7.0:rc1:*:*:*:*:*:*
89522760-C2DF-400D-9624-626D8F160CBA
OR
**System information**
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A
- TensorFlow installed from (source or binary): binary
- TensorFlow version (use command below):2.1.0
- Python version:3.7.6
- Bazel version (if compiling from source):N/A
- GCC/Compiler version (if compiling from source):N/A
- CUDA/cuDNN version:N/A
- GPU model and memory:N/A


**Describe the current behavior**
`tf.sparse.eye` crashes(aborts) when `num_rows` contains large number

**Describe the expected behavior**
expect an exception message if the input unexpected instead of crash. 


**Standalone code to reproduce the issue**
~~~python
import tensorflow as tf
import numpy as np
tf.sparse.eye(num_rows=9223372036854775807, num_columns=None)
~~~

Output
~~~python
2021-02-04 04:36:57.184236: F tensorflow/core/framework/tensor_shape.cc:345] Check failed: size >= 0 (-9223372036854775808 vs. 0)
Aborted (core dumped)
~~~
`tf.sparse.eye` crashes(aborts) when num_rows contains large number
This is a GitHub Issue
repo:tensorflow
owner:tensorflow
Title : `tf.sparse.eye` crashes(aborts) when num_rows contains large number
Issue date:

--- start body ---
**System information**
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A
- TensorFlow installed from (source or binary): binary
- TensorFlow version (use command below):2.1.0
- Python version:3.7.6
- Bazel version (if compiling from source):N/A
- GCC/Compiler version (if compiling from source):N/A
- CUDA/cuDNN version:N/A
- GPU model and memory:N/A


**Describe the current behavior**
`tf.sparse.eye` crashes(aborts) when `num_rows` contains large number

**Describe the expected behavior**
expect an exception message if the input unexpected instead of crash. 


**Standalone code to reproduce the issue**
~~~python
import tensorflow as tf
import numpy as np
tf.sparse.eye(num_rows=9223372036854775807, num_columns=None)
~~~

Output
~~~python
2021-02-04 04:36:57.184236: F tensorflow/core/framework/tensor_shape.cc:345] Check failed: size >= 0 (-9223372036854775808 vs. 0)
Aborted (core dumped)
~~~
--- end body ---

comments :
--- start comments ---

--- end comments ---