You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to create Julia scalars by calling appropriate data-types (Int8, Int16, etc.), but instead calling specific dtypes just give python builtins (e.g. int for any integer julia dtype). Or is there another way to instantiate them?
fromjuliacallimportMainasjlimportnumpyasnpa1=jl.Int8(0)
type(a1) # it's just inta2=np.int8(0)
type(a2) # it's numpy.int8
Your system
Please provide detailed information about your system:
In [80]: juliacall.__version__
Out[80]: '0.9.19'
JuliaPkg Status
/Users/.../Library/Caches/pypoetry/virtualenvs/finch-tensor-iqiMydcW-py3.10/julia_env/pyjuliapkg/juliapkg.json
Julia 1.10.0 @ /Users/.../.julia/juliaup/julia-1.10.0+0.x64.apple.darwin14/bin/julia
Packages:
Finch: {'uuid': '9177782c-1635-4eb9-9bfb-d9dfa25e6bce', 'version': '0.6.30'}
The text was updated successfully, but these errors were encountered:
This is due to how values are converted between Python and Julia.
You can do juliacall.convert(jl.Int8, 0) to get an int-like value which wraps the underlying Julia Int8 value. Some of this should be a bit slicker in v1 but that won't be out for a while...
Affects: JuliaCall
Describe the bug
I would like to create Julia scalars by calling appropriate data-types (Int8, Int16, etc.), but instead calling specific dtypes just give python builtins (e.g.
int
for any integer julia dtype). Or is there another way to instantiate them?Your system
Please provide detailed information about your system:
The text was updated successfully, but these errors were encountered: