Skip to content

TypeError: 'JVPTracer' object is not callable #21899

Answered by jakevdp
harshalc03 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the clear reproduction!

A JVPTracer is basically an array within the context of automatic differentiation. Your code is attempting to call this array as if it were a function, which leads to an error because arrays are not callable. In this line:

return ((m1_intermsof_Mcqchiachis(Mc,q, chi_s, chi_a) + m2_intermsof_Mcqchiachis(Mc,q, chi_s, chi_a))(chi_s + chi_a))/(2*m1_intermsof_Mcqchiachis(Mc,q, chi_s, chi_a))

The result of (m1_intermsof_Mcqchiachis(Mc,q, chi_s, chi_a) + m2_intermsof_Mcqchiachis(Mc,q, chi_s, chi_a) is an array; let's call it arr for simplicity. Then your expression looks like this:

return (arr(chi_s + chi_a))/(2*m1_intermsof_Mcqchiachis(Mc,q, chi_s, chi_a))

T…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@harshalc03
Comment options

Answer selected by harshalc03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants