Hi! I need to do something like this in my workflow
from juliacall import Main as jl
import numpy as np
jl.seval("""
function rs()
return randn((19,10))
end
""")
jl.seval("""
function ml(x,f)
return exp(f(x))
end
""")
sa=jl.rs()
def fas(a):
return np.sum(a)
print(type(fas(sa)))
print(jl.ml(sa,fas))
But it does not work as it cannot interpret exp(::Py)
, even if it makes sense. Do someone know why? Maybe can I fix it using something like PythonCall.pyconvert_add_rule Python to Julia · PythonCall & JuliaCall? How does it work?