Solved problem in autodiff with ANN models