# \[ANN\] DLPack.jl - Share CPU and CUDA arrays between Julia and Python

**URL:** https://discourse.julialang.org/t/ann-dlpack-jl-share-cpu-and-cuda-arrays-between-julia-and-python/76871
**Category:** Package Announcements
**Tags:** interoperability, cuda, python, pytorch, jax
**Created:** [February 21, 2022, 11:01pm UTC](https://discourse.julialang.org/t/ann-dlpack-jl-share-cpu-and-cuda-arrays-between-julia-and-python/76871 "2022-02-21T23:01:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![PabloZubieta](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@PabloZubieta](https://discourse.julialang.org/u/PabloZubieta)
#### Post date: [February 21, 2022, 11:01pm UTC](https://discourse.julialang.org/t/ann-dlpack-jl-share-cpu-and-cuda-arrays-between-julia-and-python/76871/1 "2022-02-21T23:01:29Z")

</div>

Hello, I’m pleased to announce the release of [DLPack.jl](https://github.com/pabloferz/DLPack.jl). [DLPack](https://github.com/dmlc/dlpack) is a C API that has continuously been adopted as a the base [protocol for exchanging tensor data structures](https://data-apis.org/array-api/latest/design_topics/data_interchange.html) between different python libraries including JAX, Pytorch, CuPy, among others.

It supports working with `PyCall`, `PythonCall` and allows sharing and wrapping CPU and CUDA arrays.

Here’s an example from the [README](https://github.com/pabloferz/DLPack.jl/blob/main/README.md):

```julia
using DLPack
using PyCall

np = pyimport("jax.numpy")
dl = pyimport("jax.dlpack")

pyv = np.arange(10)
v = DLPack.wrap(pyv, o -> @pycall dl.to_dlpack(o)::PyObject)

(pyv[1] == 1).item() # This is false since the first element is 0

# Let's mutate an immutable jax DeviceArray
v[1] = 1

(pyv[1] == 1).item() # true

```

Hope you find it as a nice addition to interoperate with python libraries.

Best,  
Pablo
