Add accept_scalar_or_vector. FD gradient tests passing.