Thanks for your reply, I have realized my implementation is not work, even though I have get a gradient of x according topic like Indexing a variable with a variable 7.
Thanks for your patience again.