human
I wrote the below code

    def vector_dot_fun(*args, **kwargs):
        (args, vector) = (args[:(-1)], args[(-1)])
        return np.tensordot(vector, fun(*args, **kwargs), axes=np.ndim(vector))
    return jacobian(vector_dot_fun, argnum)

What's a good function header?
assistant
#Here's a good function header.

def tensor_jacobian_product(fun, argnum=0):