not gpu registered kernels for complex numbers ( tf.complex64 and tf.complex128) for the gather_nd method of tf.Variable
@tilakrayal, I was able to replicate the issue in ubuntu 22.04 and Google Colab. Please find the gist for the same in [TF v2.11](https://colab.sandbox.google.com/gist/synandi/8823760deb26897ee84953c054ea0070/59803_2-11.ipynb) and [tf-nightly](https://colab.sandbox.google.com/gist/synandi/99f88fa17d0352dd40f850fe08658320/59754_nightly.ipynb).  Thank you! Here and standalone code to reproduce the issue, which only happens on GPU:
**not gpu registered kernels for complex numbers ( tf.complex64 and tf.complex128) for the gather_nd method of tf.Variable**

import numpy as np
import tensorflow as tf
print(tf.__version__)

with tf.device("gpu:0"):
  v = tf.Variable(np.array([1, 2, 3], np.complex64))
  print(v.gather_nd(indices = [0])) @Ivanlh20, Apologies for the delay. You are trying to pass an invalid dtype of an argument to `gather_nd`. complex64 and complex128 are not registered on GPU Kernel hence you are seeing this message. Please use a compatible dtype to avoid the issue. Thank you!
> Op: ResourceGatherNd
Node attrs: dtype=DT_COMPLEX64, Tindices=DT_INT64
Registered kernels:
  device='GPU'; dtype in [DT_INT8]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_INT8]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_UINT8]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_UINT8]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_INT16]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_INT16]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_UINT16]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_UINT16]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_UINT32]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_UINT32]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_INT64]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_INT64]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_UINT64]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_UINT64]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_DOUBLE]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_DOUBLE]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_FLOAT]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_FLOAT]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_HALF]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_HALF]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_VARIANT]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_VARIANT]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_RESOURCE]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_RESOURCE]; Tindices in [DT_INT32]
  ... Hi, 
I understand that, however, that option is available only on CPU and not on GPU:

  device='CPU'; dtype in [DT_COMPLEX128]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_COMPLEX128]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_COMPLEX64]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_COMPLEX64]; Tindices in [DT_INT32]

and I need to use **gather_nd** on GPU complex tensorflow arrays. I do not understand why it is not implemented on GPU
because there is no problem using **scatter_nd_update** on variables with complex data on GPU.
 Hi, The decision is to support only limited dtype is due to the below implementation details mentioned.
https://github.com/tensorflow/tensorflow/blob/63cb0d3dad0fe3bb1003f9b856812ade592b807a/tensorflow/core/kernels/gather_nd_op.cc#L65-L72 This issue has been marked as stale because it has no recent activity. It will be closed if no further activity occurs. Thank you. Hello,

Thank you for your reply. However, I noticed an issue in line 72. While the comment suggests that the same should be applied to the GPU kernel, the code only redirects certain dtypes for the GPU kernel.

It appears that the redirection for complex<float> and complex<double> is only implemented for the CPU kernel and not for the GPU kernel. This could be an oversight or a decision made for performance reasons.

To ensure consistency, it would be beneficial to redirect these dtypes for the GPU kernel as well. Do you know if there are plans to implement this in a future version of TensorFlow? I want to add that the complex number is widely used in physics or scientific computation in general. The direct creation and manipulation of complex number in the GPU kernel is quite important to us enabling advanced microscopy calculations with Tensorflow, otherwise strongly limiting the performance. Thus, I also hope to see this can be supported.
<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

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

No

### Source

source

### Tensorflow Version

tf 2.11

### Custom Code

Yes

### OS Platform and Distribution

Linux ubuntu 22.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 Behaviour?

```shell
not gpu registered kernels for complex number ( tf.complex64 and tf.complex128) for the gather_nd method of tf.Variable. However, it works without problems with CPU
```


### Standalone code to reproduce the issue

```shell
v = tf.Variable(np.array([1, 2, 3], np.complex64))
print(v.gather_nd(indices = [0]))
```


### Relevant log output

```shell
Colocation members, user-requested devices, and framework assigned devices, if any:
  resource (_Arg)  framework assigned device=/job:localhost/replica:0/task:0/device:GPU:0
  ResourceGatherNd (ResourceGatherNd) /job:localhost/replica:0/task:0/device:GPU:0

Op: ResourceGatherNd
Node attrs: dtype=DT_COMPLEX64, Tindices=DT_INT64
Registered kernels:
  device='GPU'; dtype in [DT_INT8]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_INT8]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_UINT8]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_UINT8]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_INT16]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_INT16]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_UINT16]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_UINT16]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_UINT32]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_UINT32]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_INT64]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_INT64]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_UINT64]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_UINT64]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_DOUBLE]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_DOUBLE]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_FLOAT]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_FLOAT]; Tindices in [DT_INT32]
  device='GPU'; dtype in [DT_HALF]; Tindices in [DT_INT64]
  device='GPU'; dtype in [DT_HALF]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_VARIANT]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_VARIANT]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_RESOURCE]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_RESOURCE]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_STRING]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_STRING]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_BOOL]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_BOOL]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_COMPLEX128]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_COMPLEX128]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_COMPLEX64]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_COMPLEX64]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_DOUBLE]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_DOUBLE]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_FLOAT]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_FLOAT]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_BFLOAT16]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_BFLOAT16]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_HALF]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_HALF]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_INT32]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_INT32]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_INT8]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_INT8]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_UINT8]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_UINT8]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_INT16]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_INT16]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_UINT16]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_UINT16]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_UINT32]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_UINT32]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_INT64]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_INT64]; Tindices in [DT_INT32]
  device='CPU'; dtype in [DT_UINT64]; Tindices in [DT_INT64]
  device='CPU'; dtype in [DT_UINT64]; Tindices in [DT_INT32]
```
</details>