If it works, it is the same as the gradient of the sum of all components in elem_prod, which is what you want for hvp. If it throws an error, you might try summing over components and the list yourself.
Best regards
Thomas