modify autodiff to work with dropout indexes