I think you are right. In your case where the v is collection of multiple vectors, your might need to tweak the components of ujp to get the correct dimension. Or you can use get_jvp for the weight of each module and then combine them together.