Use autodiff as function keyword