Using Tf Gradienttape For Automatic Differentiation