LinearOperatorInversion gives weird result on GPU for linear operators
Hi @trickiwoo, I was able to replicate the issue in Colab. Please find the gist [here](https://colab.sandbox.google.com/gist/synandi/60f540565de45d1b0cc988ed7819375d/59884.ipynb). It seems like we have to dig more into this issue, we will update soon here. Thank you!  @trickiwoo, Apologies for the delay. The reason why the code is not producing an identity matrix on GPU is because of the differences in how floating-point arithmetic is performed in GPUs. GPUs use a different set of instructions and floating-point precision, which can result in slightly different rounding errors and numerical precision when performing matrix operations. Thank you! 
This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. @synandi 
Thanks for the explanation! I understand that GPUs might use a different floating-point precision. However, it seems that in GPU it produces a significantly different result for the matrix inversion, and according to the output value of `y` (expected to be an identity matrix), it seems more than numerical precision issues? @trickiwoo your matrix is not invertible.  In particular, it has a nullspace vector `(0.5, -1, 0.5)`.  The inverse operator is finding a pseudo-inverse (but we don't make any guarantees about which one), so multiplying it back out will not yield the identity.  You're seeing different values on CPU vs GPU because they are returning different pseudo-inverses. 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/59884">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/59884">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

### Have you reproduced the bug with TF nightly?

Yes

### Source

source

### Tensorflow Version

2.13.0-dev20230222

### Custom Code

Yes

### OS Platform and Distribution

Ubuntu 20.04.4 LTS

### Mobile device

_No response_

### Python version

3.9

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

8.2.4

### GPU model and memory

_No response_

### Current Behaviour?

```shell
LinearOperatorInversion gives wrong result on GPU for linear operators. In the codes below, `y` should be an identity matrix.
```


### Standalone code to reproduce the issue

```shell
import tensorflow as tf
import numpy as np

n = 3
x = np.arange(n*n, dtype=np.float32)
x = np.reshape(x, [n,n])
p = np.dot(x.transpose(), x)

# Linear Operator
op = tf.linalg.LinearOperatorFullMatrix(p)

# Define a function to invert the operator
inv_op = tf.linalg.LinearOperatorInversion(op)

# Get the inverse operator
y = inv_op.matmul(op.to_dense())
print(y)
```


### Relevant log output

```shell
tf.Tensor(
[[ 1.   0.5 -0. ]
 [ 0.   0.   0. ]
 [ 0.   0.5  1. ]], shape=(3, 3), dtype=float32)
```
</details>