How to get gradients with respect to input and change input (rather than trainable vars) to minimize loss

my problem was solved. thanks for your guidance.
I used from it:

1 Like