def hessian_vector_product(fun, argnum=0):
    fun_grad = grad(fun, argnum)
    def vector_dot_grad(*args, **kwargs):
        args, vector = args[:-1], args[-1]
        return np.tensordot(fun_grad(*args, **kwargs), vector, np.ndim(vector))
    return grad(vector_dot_grad, argnum)  # Grad wrt original input.
Ex:
dataset/ETHPy150Open HIPS/autograd/autograd/convenience_wrappers.py/hessian_vector_product--crossover with--dataset/ETHPy150Open phaethon/scapy/scapy/route.py/Route.add