RaggedTensor slice gradient computation error
@tilakrayal 
I was able to replicate the issue in Ubuntu and colab. Please find the gist [here](https://colab.sandbox.google.com/gist/synandi/c7b9d6765441e78b1a374f481b1c7333/59727.ipynb) for TF v2.10 and [here](https://colab.sandbox.google.com/gist/synandi/4612a2921b20e8e081c594a0706d6a0c/59727-nightly.ipynb) for tf-nightly. Thank you! @cbreak-black ,Thanks for reporting this.

The error is raised from below code.
```
elif isinstance(grad, indexed_slices.IndexedSlices):
  shape_tuple = grad.values._shape_tuple()  # pylint: disable=protected-access
```
from source:
https://github.com/tensorflow/tensorflow/blob/735b325c4ba38da4c5fc265036606ce22838a242/tensorflow/python/eager/backprop.py#L606-L616
The code indicates `grad` is of `indexed_slices.IndexedSlices` and `grad.values` should return a `Tensor` as per IndexedSlices API. 

If the reported code snippet failing  then the below code from above code block also may fail which needs to be checked.
```
if isinstance(grad, ops.Tensor):
  shape_tuple = grad._shape_tuple() 
```
It may need to be digged more for root cause. Thanks! Hi, as far as I was able to find with my limited knowledge of tensorflow's internals is that grad.values is itself an `IndexedSlices` typed object. I did not find out if this is expected (apparently not), and how this came to be.
<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

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

No

### Source

source

### Tensorflow Version

2.10

### Custom Code

Yes

### OS Platform and Distribution

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
Attempting to compute the gradient, both as part of an autographed keras layer, or in eager mode, fails. This seems to happen when concatenating different slices of a ragged tensor.
```


### Standalone code to reproduce the issue

```shell
https://colab.research.google.com/drive/1kteIaQeDouRH-DEEYYeGE9jiMtgcXUZm#scrollTo=MOhPQNf4JDBB


import tensorflow as tf

values = tf.constant([0, 1,2,3,4,5,6,7,8,9], tf.float32)
values = tf.reshape(values, [-1, 1])

r = tf.RaggedTensor.from_row_lengths(values, [0, 2, 2, 1, 0, 2, 3, 0, 0])
r = tf.RaggedTensor.from_uniform_row_length(r, 3)
r = tf.RaggedTensor.from_uniform_row_length(r, 3)

def crop(raggedImage: tf.RaggedTensor, top, bottom, left, right) -> tf.RaggedTensor:
    '''
    Crops a ragged tensor, removing 'pixels' from the boundary.
    The input is interpreted as being b x h x w x s x c layout.
    Only the sample dimension may be ragged.
    '''
    if bottom > 0:
        bottom = -bottom
    else:
        bottom = None
    if right > 0:
        right = -right
    else:
        right = None
    cropped = raggedImage[:, top : bottom, left : right, :, :]
    return cropped

diameter = 3

with tf.GradientTape() as tape:
	tape.watch(r)
	l = []
	for u in range(diameter):
		for v in range(diameter):
			l.append(crop(r, u, diameter-1-u, v, diameter-1-v))
	s = tf.concat(l, axis=2)

tf.print(tape.gradient(s, [r]))
```


### Relevant log output

```shell
Traceback (most recent call last):
  File "venv-2.10/lib/python3.10/site-packages/tensorflow/python/eager/backprop.py", line 663, in _num_elements
    shape_tuple = grad.values._shape_tuple()  # pylint: disable=protected-access
AttributeError: 'IndexedSlices' object has no attribute '_shape_tuple'
```
</details>