body_fun output and input must have identical types... #14325
Unanswered
jecampagne
asked this question in
Q&A
Replies: 1 comment
-
Sorry I found just after the post...., but I think the TypeError is not easy to tackle. I've found a solution comparing the def quadIntegral(f,a,b,quad):
a = jnp.atleast_1d(a)
b = jnp.atleast_1d(b)
d = b-a
xi = a[jnp.newaxis,:]+ jnp.einsum('i...,k...->ik...',quad.absc,d)
xi = xi.squeeze() ######### <-------------------------- HERE
print("CC : xi = ",xi)
fi = f(xi)
S = d * jnp.einsum('i...,i...',quad.absw,fi)
return S.squeeze() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
I have a nasty crash that I do not manage to tackle, I ask for a kind help.
Here a snippet with
For instance
with a test
which is ok according to Mathematica
Now, the following gives a crash
But, if I use a simpler integrator (although less accurate in oscillatory functions) then
then
So I imagine an interaction between the
quadIntegral
and the_evaluate_rational
functions... but which one???Beta Was this translation helpful? Give feedback.
All reactions