Skip to main content

Website
Website
Docs
Docs
Demos
Demos
Design
Design
FAQ
FAQ


Convert Machine Learning Code Between Frameworks

Ivy enables you to:

  • Convert ML models, tools and libraries between frameworks while maintaining complete functionality using ivy.transpile
  • Create optimized graph-based models and functions in any native framework (PyTorch, TensorFlow, etc..) with ivy.trace_graph

Installing ivy

The easiest way to set up Ivy is to install it using pip:

pip install ivy
Docker Image

You can pull the Docker image for Ivy from:

docker pull ivyllc/ivy:latest
From Source

You can also install Ivy from source if you want to take advantage of the latest changes, but we can't ensure everything will work as expected 😅

git clone https://github.com/ivy-llc/ivy.git
cd ivy
pip install --user -e .

If you want to set up testing and various frameworks it's probably best to check out the Setting Up page, where OS-specific and IDE-specific instructions are available!


Supported Frameworks

These are the frameworks that ivy.transpile currently supports conversions from and to. We're working hard on adding support for more frameworks, let us know on Discord if there are source/target frameworks that would be useful for you!

Framework Source Target
PyTorch 🚧
TensorFlow 🚧
JAX 🚧
NumPy 🚧

Getting started

Ivy's transpiler allows you convert code between different ML frameworks. Have a look at our Quickstart notebook to get a brief idea of the features!

Beyond that, based on the frameworks you want to convert code between, there are a few more examples further down this page 👇 which contain a number of models and libraries transpiled between PyTorch, JAX, TensorFlow and NumPy.


Using ivy

Here's some examples, to help you get started using Ivy! The examples page also features a wide range of demos and tutorials showcasing some more use cases for Ivy.

Transpiling any code from one framework to another
import ivy
import torch
import tensorflow as tf

def torch_fn(x):
    a = torch.mul(x, x)
    b = torch.mean(x)
    return x * a + b

tf_fn = ivy.transpile(torch_fn, source="torch", target="tensorflow")

tf_x = tf.convert_to_tensor([1., 2., 3.])
ret = tf_fn(tf_x)
Tracing a computational graph of any code
import ivy
import torch

def torch_fn(x):
    a = torch.mul(x, x)
    b = torch.mean(x)
    return x * a + b

torch_x = torch.tensor([1., 2., 3.])
graph = ivy.trace_graph(jax_fn, to="torch", args=(torch_x,))
ret = graph(torch_x)

How ivy works?

Let's take a look at how Ivy works as a transpiler in more detail to get an idea of why and where to use it.

When is Ivy's transpiler useful?

If you want to use building blocks published in other frameworks (neural networks, layers, array computing libraries, training pipelines...), you want to integrate code developed in various frameworks, or maybe straight up migrate code from one framework to another or even between versions of the same framework, the transpiler is definitely the tool for the job! You can use the converted code just as if it was code originally developed in that framework, applying framework-specific optimizations or tools, instantly exposing your project to all of the unique perks of a different framework.


Ivy's transpiler allows you to use code from any other framework (or from any other version of the same framework!) in your own code, by just adding one line of code.

This way, Ivy makes all ML-related projects available for you, independently of the framework you want to use to research, develop, or deploy systems. Feel free to head over to the docs for the full API reference, but the functions you'd most likely want to use are:

# Converts framework-specific code to a target framework of choice. See usage in the documentation
ivy.transpile()

# Traces an efficient fully-functional graph from a function, removing all wrapping and redundant code. See usage in the documentation
ivy.trace_graph()

ivy.transpile will eagerly transpile if a class or function is provided

import ivy
import torch
import tensorflow as tf

def torch_fn(x):
    x = torch.abs(x)
    return torch.sum(x)

x1 = torch.tensor([1., 2.])
x1 = tf.convert_to_tensor([1., 2.])

# Transpilation happens eagerly
tf_fn = ivy.transpile(test_fn, source="torch", target="tensorflow")

# tf_fn is now tensorflow code and runs efficiently
ret = tf_fn(x1)

ivy.transpile will lazily transpile if a module (library) is provided

import kornia

x2 = torch.rand(5, 3, 4, 4)

# Module is provided -> transpilation happens lazily
tf_kornia = ivy.transpile(kornia, source="torch", target="tensorflow")

# The transpilation is initialized here, and this function is converted to tensorflwo
ret = tf_kornia.color.rgb_to_grayscale(x2)

# Transpilation has already occurred, the tensorflow function runs efficiently
ret = tf_kornia.color.rgb_to_grayscale(x2)

ivy.trace_graph can be used eagerly or lazily

If you pass the necessary arguments for function tracing, the graph tracing step will happen instantly (eagerly). Otherwise, the graph tracing will happen only when the returned function is first invoked.

import ivy
import jax
ivy.set_backend("jax")

# Simple JAX function to transpile
def test_fn(x):
    return jax.numpy.sum(x)

x1 = ivy.array([1., 2.])
# Arguments are available -> tracing happens eagerly
eager_graph = ivy.trace_graph(test_fn, to="jax", args=(x1,))

# eager_graph now runs efficiently
ret = eager_graph(x1)
# Arguments are not available -> tracing happens lazily
lazy_graph = ivy.trace_graph(test_fn, to="jax")

# The traced graph is initialized, tracing will happen here
ret = lazy_graph(x1)

# Tracing has already happend, traced graph runs efficiently
ret = lazy_graph(x1)

If you want to learn more, you can find more information in the Ivy as a transpiler section of the docs!


Documentation

You can find Ivy's documentation on the Docs page, which includes:

  • Motivation: This contextualizes the problem Ivy is trying to solve by going over
  • Related Work: Which paints a picture of the role Ivy plays in the ML stack, comparing it to other existing solutions in terms of functionalities and abstraction level.
  • Design: A user-focused guide about the design decision behind the architecture and the main building blocks of Ivy.
  • Deep Dive: Which delves deeper into the implementation details of Ivy and is oriented towards potential contributors to the code base.

Contributing

We believe that everyone can contribute and make a difference. Whether it's writing code, fixing bugs, or simply sharing feedback, your contributions are definitely welcome and appreciated 🙌

Check out all of our Open Tasks, and find out more info in our Contributing guide in the docs! Or to immediately dive into a useful task, look for any failing tests on our Test Dashboard!


Community



Join our growing community on a mission to make conversions between frameworks simple and accessible to all! Whether you are a seasoned developer or just starting out, you'll find a place here! Join the Ivy community on our Discord 👾 server, which is the perfect place to ask questions, share ideas, and get help from both fellow developers and the Ivy Team directly.

See you there!


Citation

If you use Ivy for your work, please don't forget to give proper credit by including the accompanying paper 📄 in your references. It's a small way to show appreciation and help to continue to support this and other open source projects 🙌

@article{lenton2021ivy,
  title={Ivy: Templated deep learning for inter-framework portability},
  author={Lenton, Daniel and Pardo, Fabio and Falck, Fabian and James, Stephen and Clark, Ronald},
  journal={arXiv preprint arXiv:2102.02886},
  year={2021}
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ivy-0.0.9.17.tar.gz (22.5 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ivy-0.0.9.17-cp313-cp313-win_amd64.whl (17.9 MB view details)

Uploaded CPython 3.13Windows x86-64

ivy-0.0.9.17-cp313-cp313-manylinux_2_17_x86_64.whl (18.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

ivy-0.0.9.17-cp313-cp313-macosx_12_0_arm64.whl (23.0 MB view details)

Uploaded CPython 3.13macOS 12.0+ ARM64

ivy-0.0.9.17-cp312-cp312-win_amd64.whl (18.1 MB view details)

Uploaded CPython 3.12Windows x86-64

ivy-0.0.9.17-cp312-cp312-manylinux_2_17_x86_64.whl (18.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

ivy-0.0.9.17-cp312-cp312-macosx_12_0_arm64.whl (23.5 MB view details)

Uploaded CPython 3.12macOS 12.0+ ARM64

ivy-0.0.9.17-cp311-cp311-win_amd64.whl (17.2 MB view details)

Uploaded CPython 3.11Windows x86-64

ivy-0.0.9.17-cp311-cp311-manylinux_2_17_x86_64.whl (17.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

ivy-0.0.9.17-cp311-cp311-macosx_12_0_arm64.whl (23.8 MB view details)

Uploaded CPython 3.11macOS 12.0+ ARM64

ivy-0.0.9.17-cp310-cp310-win_amd64.whl (17.2 MB view details)

Uploaded CPython 3.10Windows x86-64

ivy-0.0.9.17-cp310-cp310-manylinux_2_17_x86_64.whl (18.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ivy-0.0.9.17-cp310-cp310-macosx_12_0_arm64.whl (23.8 MB view details)

Uploaded CPython 3.10macOS 12.0+ ARM64

ivy-0.0.9.17-cp39-cp39-win_amd64.whl (18.0 MB view details)

Uploaded CPython 3.9Windows x86-64

ivy-0.0.9.17-cp39-cp39-manylinux_2_17_x86_64.whl (18.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

ivy-0.0.9.17-cp38-cp38-win_amd64.whl (18.1 MB view details)

Uploaded CPython 3.8Windows x86-64

ivy-0.0.9.17-cp38-cp38-manylinux_2_17_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file ivy-0.0.9.17.tar.gz.

File metadata

  • Download URL: ivy-0.0.9.17.tar.gz
  • Upload date:
  • Size: 22.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for ivy-0.0.9.17.tar.gz
Algorithm Hash digest
SHA256 ff428fb77eccd9124b1c1f304988c8d60e6040d261a17f08b50b538814b0e657
MD5 bc1fc673948b9e71052b4684c863fc68
BLAKE2b-256 e4bfd2c34f74774937e3463e371ecac239545874ff68cfc74c9a4a9a41fb16a4

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: ivy-0.0.9.17-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 17.9 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for ivy-0.0.9.17-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ceaf079d6fe9006f5ef8d455a568573a16ca957f5c9608343388d130f4539d7a
MD5 fa76d95eea4805add289396dac0096ba
BLAKE2b-256 0d01a582a00f921553e0b56c94ba75183990eee8f62a2aba8470f88a28ae399e

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp313-cp313-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ivy-0.0.9.17-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 a0f37d8c7f6cd428e2e042f34014ec2163e544b13898e08871cc391621a50b08
MD5 5aedfbbd104116aad8c689cc914c983e
BLAKE2b-256 c6157a244c9a67f3f8508f0f6be840471e9298a0ee01c2a09f27153d9783dd9c

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp313-cp313-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for ivy-0.0.9.17-cp313-cp313-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 b950fea0c6a1ba755d88076a6371d5fa7d68ecc7f7ed83775e06b77e3c450bdc
MD5 b12ac4f629859dc4315c068c37ddc2ed
BLAKE2b-256 5f25e4c08af4d38e01d8749257c7aa6b3c1501ad9a29564b9202b7c9721fe0d4

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: ivy-0.0.9.17-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 18.1 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for ivy-0.0.9.17-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d87fb816f908c0e9535795d02f674819295a3e45dfdbcd56e791b5fe06c1f5b9
MD5 2ed394f4dd02fb41dec66d66d677ac3a
BLAKE2b-256 3f91acbd7c0959fb141bbcd13418bfc4c8119c4437c1ca1c19e014552bb4d09b

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp312-cp312-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ivy-0.0.9.17-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 408c6aceb5b7e921e044b00e2a478db9d28cb73dd491d723720fba69f4981290
MD5 5b72b6629695763e72c918ee4151fa9a
BLAKE2b-256 264179c9c7f5fb0d9d0e9ddbf7ca4ef2c58b0d32fb8e0d5f5412a3554572d96e

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp312-cp312-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for ivy-0.0.9.17-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 86d8d3bddf82387e6a5697e2331e62728cbbb21ae726d9600f0f306d24177854
MD5 ab1237242fb5e870887efce00916e5f9
BLAKE2b-256 66401e2c59fa18bcdecf8e126abb5d77d45ac0abd5fd2cac208c4bac788b9c3a

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: ivy-0.0.9.17-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 17.2 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for ivy-0.0.9.17-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8698ff06bc2f4480d8c0703a735598089c8e8a885d7d9c9f98b38619c78fd486
MD5 f83954967c2c6c5b5a38251c063ce652
BLAKE2b-256 7ed5c6dbe512eeb8452d1e5a026c6f5c598dd5901880f62ba3905d9a87713c02

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp311-cp311-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ivy-0.0.9.17-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c18ca80e3f681b6219605e599e230191476f855c3374fdd8d626b84be2ac9c87
MD5 d65962af50368628724bce168fc351a2
BLAKE2b-256 dea678751d4779311d6e477e470094df22b2b50ecd1b334bfbd6a8d74507fd0d

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp311-cp311-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for ivy-0.0.9.17-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 b8272d072cb8d4fdaaed03f547d33d59bd96a57782f6196af7abef2f73d9798d
MD5 a7f02ddeac7d7fb0dccdf13f892c3b24
BLAKE2b-256 8d3fe32f95389ec2e5ffa8a69e9486408100fec5cd006b59c48e9873ec60d649

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: ivy-0.0.9.17-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 17.2 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for ivy-0.0.9.17-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3627c369e471cfbd8917f7eb2d4df9743e3f9da6f733841fb0133c7370b4fe43
MD5 cc28d329fa2f74739729e9fc1f05b618
BLAKE2b-256 dbe26a6b4c4f5059bcaea37c04e5f7df090d4a883aacf0bd26d23d916d68a317

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp310-cp310-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ivy-0.0.9.17-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 3ab173a61cf3c0f134f5a2fb55bb4657d9d17e96404817b9e440dddd524f20b0
MD5 5dd11754d62eb2187aa7a22ce7bb7ac0
BLAKE2b-256 af29a2093da3ede76425e97def77469116661c7d5181658f2bcf36598b1727bb

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp310-cp310-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for ivy-0.0.9.17-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 399c512c3ee072110258505496ab916bd06b8a24ae19b18b4a578601f5b2966f
MD5 ed969f537c10a93674af2ad5de536e46
BLAKE2b-256 4fd4e7de09b11a5d8adf379758ac43214ddc77e217c5cfc75ba398cf1f678a83

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: ivy-0.0.9.17-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 18.0 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for ivy-0.0.9.17-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0ba4187db427f339a53ef678a7c5c7ba26e34e8552439e61653107ace6595d9e
MD5 e6d387ef908e78465313118db7e1b173
BLAKE2b-256 c63e0b831680d7687de2b714b5b0780babb54666f4ed33fe433bc81c2076d934

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp39-cp39-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ivy-0.0.9.17-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 aaeddda2edc2b40e2ac87c6f73526eb6353960984bc802b395a88efc943b030b
MD5 79d52bd0914fef0a1b98d42e2ec742a2
BLAKE2b-256 0709468483ce778e8b67e285852e11c6ddbbe7084569a40f9616c65ca1729889

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: ivy-0.0.9.17-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 18.1 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for ivy-0.0.9.17-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 467fade41bf11afdf6d8a6188c563844a0ed321c0de64aa3c371f6c46e2f9980
MD5 2429977704da8585e76c1acbc709a3e0
BLAKE2b-256 ba1191ea7269fa0ab64f9d6b06b3cdb628b1a1e58c8c0a770aaa029b25c4b6e3

See more details on using hashes here.

File details

Details for the file ivy-0.0.9.17-cp38-cp38-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ivy-0.0.9.17-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7e0a0126616712dd87c0289eef099b033d111eede6276cd2841bafbeb517c0ec
MD5 f27cbf2fa9c330f5e7162dd9f39badff
BLAKE2b-256 7510b90e83cf7f1ab4b16811f1ab426040ea9420a896bad1afb6239193acec3c

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.0.5

2 files

1.0.0.4

2 files

1.0.0.3

2 files

1.0.0.2

2 files

1.0.0.1

17 files

1.0.0.0

17 files

This release

0.0.9.17 This release

17 files

0.0.9.16

17 files

0.0.9.15

17 files

0.0.9.14

17 files

0.0.9.13

14 files

0.0.9.12

14 files

0.0.9.10

14 files

0.0.9.9

14 files

0.0.9.8

14 files

0.0.9.7

11 files

0.0.9.6

11 files

0.0.9.5

11 files

0.0.9.4

11 files

0.0.9.3

11 files

0.0.9.2

11 files

0.0.9.1

11 files

0.0.9.0

11 files

0.0.8.0

11 files

0.0.7.5

11 files

0.0.7.4

11 files

0.0.7.3

11 files

0.0.7.2

11 files

0.0.7.1

11 files

0.0.7.0

11 files

0.0.6.2

7 files

0.0.6.1

7 files

0.0.6.0

7 files

0.0.5.1

7 files

0.0.5.0

7 files

0.0.4.0

2 files

0.0.3.0

2 files

0.0.2.0

2 files

0.0.1.0

2 files

0.0.0

4 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page