`Overflow` in `tf.raw_ops.SparseReduceMaxSparse` when there are too large values in `input_shape`.
@xl1043237213,
Thank you for reporting the issue. I was able to reproduce the issue on tensorflow v2.15, v2.16 and tf-nightly. Kindly find the gist of it [here](https://colab.sandbox.google.com/gist/tilakrayal/99b080faded029711517f4dd9864ab27/untitled1866.ipynb). Not a bug - the shape is too large and informing you of this. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/65865">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/65865">No</a>
 > Not a bug - the shape is too large and informing you of this.

Can you tell me in more detail why the issue is not considered a bug? `INVALID_ARGUMENT` is an error type defined by TensorFlow but causes the program to crash, should this be avoided? > > Not a bug - the shape is too large and informing you of this.
> 
> Can you tell me in more detail why the issue is not considered a bug? `INVALID_ARGUMENT` is an error type defined by TensorFlow but causes the program to crash, should this be avoided?

Throwing an error is not a crash.  The error is telling you that your input argument is invalid. > > > Not a bug - the shape is too large and informing you of this.
> > 
> > 
> > Can you tell me in more detail why the issue is not considered a bug? `INVALID_ARGUMENT` is an error type defined by TensorFlow but causes the program to crash, should this be avoided?
> 
> Throwing an error is not a crash. The error is telling you that your input argument is invalid.

Error is thrown by C/C++ code, causing the Python interpreter to crash, and similarly `Check failed`. Are these errors not considered bugs?🤔 > > > > Not a bug - the shape is too large and informing you of this.
> > > 
> > > 
> > > Can you tell me in more detail why the issue is not considered a bug? `INVALID_ARGUMENT` is an error type defined by TensorFlow but causes the program to crash, should this be avoided?
> > 
> > 
> > Throwing an error is not a crash. The error is telling you that your input argument is invalid.
> 
> Error is thrown by C/C++ code, causing the Python interpreter to crash

The interpreter does not crash - an exception is thrown, and you can catch it in python.

>, and similarly `Check failed`. Are these errors not considered bugs?🤔

We don't consider those serious bugs, especially if you intentionally provide obviously invalid data with the sole intention of trying to trigger a crash. Thanks for your patient answer. 

I'd like to know how to catch the exception. When you run the code in [colab](https://colab.research.google.com/drive/1XHTMWmfVRuKBorPLZyk6iUv29_AUr8HF?usp=sharing), the web page will throw error message "Your session crashed for an unknown reason". When you run the code using `subprocess`, you can get return code [-6](https://www-uxsup.csx.cam.ac.uk/courses/moved.Building/signals.pdf). I think the exception is thrown by C/C++ code but cannot be caught by the Python process. 

It is true that this is an artificially constructed invalid input, but improper handling of the boundary case may affect the stability of the program execution😔 > Thanks for your patient answer.
> 
> I'd like to know how to catch the exception. When you run the code in [colab](https://colab.research.google.com/drive/1XHTMWmfVRuKBorPLZyk6iUv29_AUr8HF?usp=sharing), the web page will throw error message "Your session crashed for an unknown reason". When you run the code using `subprocess`, you can get return code [-6](https://www-uxsup.csx.cam.ac.uk/courses/moved.Building/signals.pdf). I think the exception is thrown by C/C++ code but cannot be caught by the Python process.
> 
> It is true that this is an artificially constructed invalid input, but improper handling of the boundary case may affect the stability of the program execution😔

Thanks, the error was not propagated correctly to python.  It was a quick fix, so should now work.

But in general, we now deprioritize any artificial edge-case issues like this that are not encountered by real-world models.
### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

binary

### TensorFlow version

tf 2.15

### Custom code

No

### OS platform and distribution

Linux Ubuntu 20.04

### Mobile device

_No response_

### Python version

3.10

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

`Overflow` in `tf.raw_ops.SparseReduceMaxSparse` when there are too large values in `input_shape`. See the colab link below for details.

### Standalone code to reproduce the issue

```shell
https://colab.research.google.com/drive/1XHTMWmfVRuKBorPLZyk6iUv29_AUr8HF?usp=sharing
```


### Relevant log output

```shell
Non-OK-status: InitDims(dim_sizes) status: INVALID_ARGUMENT: Encountered overflow when multiplying 2684354560 with 666666666666, result: -1
```
