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.15.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.15-cp313-cp313-win_amd64.whl (17.8 MB view details)

Uploaded CPython 3.13Windows x86-64

ivy-0.0.9.15-cp313-cp313-manylinux_2_17_x86_64.whl (17.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.13macOS 12.0+ ARM64

ivy-0.0.9.15-cp312-cp312-win_amd64.whl (18.0 MB view details)

Uploaded CPython 3.12Windows x86-64

ivy-0.0.9.15-cp312-cp312-manylinux_2_17_x86_64.whl (18.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

ivy-0.0.9.15-cp312-cp312-macosx_12_0_arm64.whl (23.4 MB view details)

Uploaded CPython 3.12macOS 12.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

ivy-0.0.9.15-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.15-cp311-cp311-macosx_12_0_arm64.whl (23.7 MB view details)

Uploaded CPython 3.11macOS 12.0+ ARM64

ivy-0.0.9.15-cp310-cp310-win_amd64.whl (17.1 MB view details)

Uploaded CPython 3.10Windows x86-64

ivy-0.0.9.15-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.15-cp310-cp310-macosx_12_0_arm64.whl (23.7 MB view details)

Uploaded CPython 3.10macOS 12.0+ ARM64

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

Uploaded CPython 3.9Windows x86-64

ivy-0.0.9.15-cp39-cp39-manylinux_2_17_x86_64.whl (18.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.8Windows x86-64

ivy-0.0.9.15-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.15.tar.gz.

File metadata

  • Download URL: ivy-0.0.9.15.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.15.tar.gz
Algorithm Hash digest
SHA256 0de6e9dd8a96a3741d56a1cc8c442c247cf6ccb70ef4908b39f55b65d957300e
MD5 a53476ea068efdd8c7ee4d9b2a419422
BLAKE2b-256 77157e1697186dbefd278ea51fd4beae1aae791c6a00afb536fc85c1f8eab206

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.15-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 17.8 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.15-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 80852d3fbbd429ec4aa1d23c38d009b07dcbbeaa2a4deb4f8c8c920b7ab3c9dd
MD5 1d71efb12f154c34449b97a987ddee8e
BLAKE2b-256 96bb86bddc69ed8e8d0e42a02ea1f891b41e848cb65a8bab9924dae2a5d4d9f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.15-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 36a302249c9d072a19c85bf79e82e0cfe0cd599ef5c5f5669c350e84d5977d1d
MD5 bcc7608cf93d04a99ebb5dcf41b19125
BLAKE2b-256 18362fe334b88156ab528a27e9ac14836a6eae04a9b8b3e4f3b0b1d870600b06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.15-cp313-cp313-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 305616f9dcc47f22672993f4c5de2c8bb3dbe47a1f67801cfbeee4e818cfb069
MD5 1eb36f47e4484d4b795065249692e17a
BLAKE2b-256 b51915ba55a5e43a0209e948e736df99c1d3277760cda95fcc52870a2e7217c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.15-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 18.0 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.15-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b929e2758b8575df5377c53aaa180ae2f6ba06a84735e5ae995e6ea014f9f7e7
MD5 a857d20a298c4e605b883b1a96dd81b1
BLAKE2b-256 f27c4b6e5b6756cb327b2a61e8e414ee87a656411de4119a3a11365e2fcca7d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.15-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 824f5a42ece9c7a8d9eefd55d68885e471c32ae340b6a495f0575be56e4dc78b
MD5 52939ca486232ba58759c9c5e87ec739
BLAKE2b-256 75657c283c95a03605b14db94b0b5e550a26f16bab1e0fdc452c18707e5d1f98

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.15-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 d7f49a6cc6025adac9c1c19e1f2be25c6670d82d2a0b85e7c4b6aa96f803f4a3
MD5 e5f15d0b144dfa8b65259af2f9c95a8e
BLAKE2b-256 d7348b94958ff69817879f79925bc50d29cd3c092a46faaf7bf98b13bbe95ea5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.15-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.15-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 21c135d83c53e58b24125833e9b1d074bccdfa2add61ee339ef505d5328fb9b1
MD5 b613ec96640bc3a4577048cfcc4e987d
BLAKE2b-256 901394d6959e3156df2110652d48ca434be7faa313e8aa8dd396a4c9d3330d00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.15-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8d8f6c80a709f651b1da9c9bec158fc36998caba4b8153cfa96ef9993c4103d1
MD5 6bf1b2e91ec873012489f0730009acd0
BLAKE2b-256 5f4713a225a66fe1855b1fe136378ab9922a94bdd530388bbedb6525e7d1f1d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.15-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 16e625969ea4419cdd85c5921d9a6bf35bd66bb232bea5cad47b7a567cceb3c2
MD5 4293fcda2cc7454f30fb5757ec0e37d4
BLAKE2b-256 e7f4706d90e38b0409abca68c01fcbb27388049bf8890039a2c936de1b7b0a82

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.15-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 17.1 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.15-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5a666ff596d997036fe85fe27152cd5bd432666e526a013f98fcaa749d99885f
MD5 b24fb502e40091a5f3c01560ab3bc65b
BLAKE2b-256 e4fc339df3818f733a8221bba49a2ba4a09db0cb556603a7347a641b5ca1a694

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.15-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c4019c8f2f72aa235ad24dcafec81954b98e800eb4514cf500e88d0baedf7f68
MD5 2b4c5088d51b60aa97022497e32db9b4
BLAKE2b-256 585b8e3a89d7016f8e34d764fe3a50991d27172e9c0d6ab4ab59d51c7dea05af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.15-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 a77ff255aa9ca9faae4fc1f8d7fd75940e3cb56b5f8213aa733713acd792c223
MD5 3aed350f576d9218595debc462a2982c
BLAKE2b-256 12895ade20517c8e33ece3cc43849cc7c679d6a09307f7282cea13eb887561c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.15-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.15-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9cfc1d95e5328f0a5ac173b7b16b3927ca40e6a2b641c945ab0e89b529cb3aea
MD5 9de193bd512e5491ec33c6f77a9e30b2
BLAKE2b-256 abee160d11e8bfb91d565e1b135b2085170cf0ddb2fbcb1419b3579ab0c8b8ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.15-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 a134614dc013abf0a3c7681b5127d041e2b24d5caf5b29083e1d39021a87a640
MD5 cb5cdb2fc3d24a079be1558d6cfd3d4f
BLAKE2b-256 1eadc659a3e921e7aad47657dd652222a241d37d773e04935fb5048d1d572551

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.15-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.15-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b7cb510d1c4b07a0c854d0f2d91095917fc5f2183a5632b539659a7608a05c4b
MD5 f50efccca41a55edc9b6cda0bd21450b
BLAKE2b-256 907944ca52ed056244b4106d133bf5aca150fa6f828fe48185736cf5c3d23483

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.15-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6d2c4b833c084cc2214fcff59531412df920f9e6a16c94cc27b9748f04da5325
MD5 8c20cd99e8634b45d9135c05f0cef7a4
BLAKE2b-256 f4ae160c84eec11dadf77cf60ac30d6392fc6bd7a314fb059692ffe22d9068ed

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

0.0.9.17

17 files

0.0.9.16

17 files

This release

0.0.9.15 This release

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