TypeError: Cannot convert 0.1 to EagerTensor of dtype int64
I actually wrote a learning rate scheduler which gave the same error

```python
class PowerScheduler(keras.optimizers.schedules.LearningRateSchedule):
    def __init__(self,lr,decay,c):
        super().__init__()
        self.lr = lr
        self.decay = decay
        self.c = c

    def __call__(self,step):
        return self.lr/((1+(step*self.decay))**self.c)

optim = keras.optimizers.SGD(learning_rate=PowerScheduler(lr=1e-2,decay=1e-4,c=1))

``` solved it...didn't knew step was actually a resource variable so i was treating it as a constant.
casting it to a float32 along with other parameters solved the problem

```python

class PowerScheduler(keras.optimizers.schedules.LearningRateSchedule):
    def __init__(self,lr,decay,c):
        super(PowerScheduler,self).__init__()
        self.lr = tf.constant(lr,dtype=tf.float32)
        self.decay = tf.constant(decay,tf.float32)
        self.c = tf.constant(c,tf.float32)

    def __call__(self,step):
        step = tf.cast(step,tf.float32)
        return self.lr/((1+(step*self.decay))**self.c)

optim = keras.optimizers.SGD(learning_rate=PowerScheduler(lr=1e-2,decay=1e-4,c=1))

``` 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/60649">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/60649">No</a>

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

Support

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

No

### Source

source

### Tensorflow Version

2.12.0

### Custom Code

Yes

### OS Platform and Distribution

GoogleColab

### Mobile device

_No response_

### Python version

3.10.11

### Bazel version

colab

### GCC/Compiler version

colab

### CUDA/cuDNN version

colab

### GPU model and memory

colab

### Current Behaviour?

getting this error when i execute the code present in tensowflow website to implement tf.keras.optimizers.schedules.LearningRateSchedule 
error:

TypeError: Cannot convert 0.1 to EagerTensor of dtype int64

```python
class MyLRSchedule(tf.keras.optimizers.schedules.LearningRateSchedule):

  def __init__(self, initial_learning_rate):
    self.initial_learning_rate = initial_learning_rate

  def __call__(self, step):
     return self.initial_learning_rate / (step + 1)

optimizer = tf.keras.optimizers.SGD(learning_rate=MyLRSchedule(0.1))

```

### Standalone code to reproduce the issue

```shell
TypeError: Cannot convert 0.1 to EagerTensor of dtype int64
```


### Relevant log output

TypeError                                 Traceback (most recent call last)
[<ipython-input-145-86d045432fd5>](https://localhost:8080/#) in <cell line: 9>()
      7      return self.initial_learning_rate / (step + 1)
      8 
----> 9 optimizer = tf.keras.optimizers.SGD(learning_rate=MyLRSchedule(0.1))

4 frames
[/usr/local/lib/python3.10/dist-packages/keras/optimizers/sgd.py](https://localhost:8080/#) in __init__(self, learning_rate, momentum, nesterov, weight_decay, clipnorm, clipvalue, global_clipnorm, use_ema, ema_momentum, ema_overwrite_frequency, jit_compile, name, **kwargs)
    121             **kwargs
    122         )
--> 123         self._learning_rate = self._build_learning_rate(learning_rate)
    124         self.momentum = momentum
    125         self.nesterov = nesterov

[/usr/local/lib/python3.10/dist-packages/keras/optimizers/optimizer.py](https://localhost:8080/#) in _build_learning_rate(self, learning_rate)
    382                 # Create a variable to hold the current learning rate.
    383                 current_learning_rate = tf.convert_to_tensor(
--> 384                     learning_rate(self.iterations)
    385                 )
    386                 self._current_learning_rate = tf.Variable(

[<ipython-input-145-86d045432fd5>](https://localhost:8080/#) in __call__(self, step)
      5 
      6   def __call__(self, step):
----> 7      return self.initial_learning_rate / (step + 1)
      8 
      9 optimizer = tf.keras.optimizers.SGD(learning_rate=MyLRSchedule(0.1))

[/usr/local/lib/python3.10/dist-packages/tensorflow/python/util/traceback_utils.py](https://localhost:8080/#) in error_handler(*args, **kwargs)
    151     except Exception as e:
    152       filtered_tb = _process_traceback_frames(e.__traceback__)
--> 153       raise e.with_traceback(filtered_tb) from None
    154     finally:
    155       del filtered_tb

[/usr/local/lib/python3.10/dist-packages/tensorflow/python/framework/constant_op.py](https://localhost:8080/#) in convert_to_eager_tensor(value, ctx, dtype)
    101       dtype = dtypes.as_dtype(dtype).as_datatype_enum
    102   ctx.ensure_initialized()
--> 103   return ops.EagerTensor(value, ctx.device_name, dtype)
    104 
    105 

TypeError: Cannot convert 0.1 to EagerTensor of dtype int64

</details>