Nan occurs when calculating the determinant of matrix including inf
Hi @QuantumCoder4 ,

I have replicated the reported behaviour and attached [gist](https://colab.research.google.com/gist/SuryanarayanaY/8a29b771b8b907b5a9b2f53fba16bfa5/63052.ipynb) for reference.

IMO, `inf-inf `should be `Nan` as both inf can be anything and their difference could be anything from -inf to +inf. I have checked this behaviour with numpy and observed `np.inf-np.inf = Nan`. In TF, `tf.linalg.det([[np.inf, np.inf], [1, 1]])=0 `also doesn't seem right IMO.

`np.inf-1=np.inf` make sense to me.In TF, `tf.linalg.det([np.inf, 1], [1, 1]])=nan` should be `inf` IMO.

However this behaviour with inf may be different in different frameworks. Let's hear from Devteam. Thanks! I agree with @SuryanarayanaY's analysis, the result should be `inf` and `nan` for the two examples. 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/63052">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/63052">No</a>

### Issue type

Bug

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

Yes

### Source

source

### TensorFlow version

2.15.0

### Custom code

Yes

### OS platform and distribution

_No response_

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

When the matrix include np.inf, the tf.linalg.det returns NaN for some cases. 
If the matrix is: [[inf, inf], [1,1]], the determinant is 0, which makes sense to me since inf\*1-inf\*1=0.
However, if the matrix is [[inf, 1], [1, 1]], the API will directly outputs NaN instead of inf since: inf\*1 -1\*1 = inf. 

### Standalone code to reproduce the issue

```shell
import tensorflow as tf
def tensorflow_call(input):
  return tf.linalg.det(input)

input = tf.constant([[np.inf, 1], [1, 1]], dtype='float64')
print(tf.linalg.det(input))  # nan

input = tf.constant([[np.inf, np.inf], [1, 1]], dtype='float64')
print(tf.linalg.det(input))  # 0
```


### Relevant log output

_No response_