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.14.tar.gz (15.6 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.14-cp313-cp313-win_amd64.whl (10.9 MB view details)

Uploaded CPython 3.13Windows x86-64

ivy-0.0.9.14-cp313-cp313-manylinux_2_17_x86_64.whl (10.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

ivy-0.0.9.14-cp313-cp313-macosx_12_0_arm64.whl (16.1 MB view details)

Uploaded CPython 3.13macOS 12.0+ ARM64

ivy-0.0.9.14-cp312-cp312-win_amd64.whl (11.0 MB view details)

Uploaded CPython 3.12Windows x86-64

ivy-0.0.9.14-cp312-cp312-manylinux_2_17_x86_64.whl (11.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

ivy-0.0.9.14-cp312-cp312-macosx_12_0_arm64.whl (16.4 MB view details)

Uploaded CPython 3.12macOS 12.0+ ARM64

ivy-0.0.9.14-cp311-cp311-win_amd64.whl (9.9 MB view details)

Uploaded CPython 3.11Windows x86-64

ivy-0.0.9.14-cp311-cp311-manylinux_2_17_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

ivy-0.0.9.14-cp311-cp311-macosx_12_0_arm64.whl (16.5 MB view details)

Uploaded CPython 3.11macOS 12.0+ ARM64

ivy-0.0.9.14-cp310-cp310-win_amd64.whl (9.9 MB view details)

Uploaded CPython 3.10Windows x86-64

ivy-0.0.9.14-cp310-cp310-manylinux_2_17_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ivy-0.0.9.14-cp310-cp310-macosx_12_0_arm64.whl (16.4 MB view details)

Uploaded CPython 3.10macOS 12.0+ ARM64

ivy-0.0.9.14-cp39-cp39-win_amd64.whl (9.9 MB view details)

Uploaded CPython 3.9Windows x86-64

ivy-0.0.9.14-cp39-cp39-manylinux_2_17_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

ivy-0.0.9.14-cp38-cp38-win_amd64.whl (9.9 MB view details)

Uploaded CPython 3.8Windows x86-64

ivy-0.0.9.14-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.14.tar.gz.

File metadata

  • Download URL: ivy-0.0.9.14.tar.gz
  • Upload date:
  • Size: 15.6 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.14.tar.gz
Algorithm Hash digest
SHA256 3a3470916602d879acdf4085e9685b85f74030b1d15a3207b43586368af9d6eb
MD5 a636f315dac149d698e019e91459dd68
BLAKE2b-256 af49dc1a4768e4a04a5ca11e4101961174bcabcbb6d1b2ef970b549c75db7c29

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.14-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 10.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.14-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b6e4e8397cb490b7b1ec9c97c90d7582a2fc72712d4bd9d190b5259a213165e2
MD5 aa5aa38f98dfd909db5d804fab56b0a5
BLAKE2b-256 499fa80d798695665e28f5db057ceeb566ac9944401719f00ac888d0e427fc56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.14-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5247191aac5c431a7d11189ee2494b5fa4d9a3af3737319a39ef361d5860031b
MD5 dba40b7d99ac64faa9a6a84838e78e11
BLAKE2b-256 f1d55f1ae0e2e3ae709740d4ea42c4a467bbfb28058b229d32a85f08ca9c8865

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.14-cp313-cp313-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 ba509b5662986a84de62ec6453efd54bd8f53a83577fc77fd97459b1d15ae618
MD5 c7c9d7bbbf695a8e66e2fe7d38a9ffac
BLAKE2b-256 fbf74dd7f4d800e97575499c2b9f02aa3fe510176765aee9dacd3280f8d4cc75

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.14-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 11.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.14-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a368fdafaca13b8f57a1a2a6b103e5c2873cb4e87b9c83f7cfa42c7a31524e10
MD5 8667c63d59429047859f5f447a2bb6b4
BLAKE2b-256 0524af45eb01bd868e30a43c42c613d83f2b37e9b197132c1ba8f3c859453336

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.14-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6e8a75734604e7249daa306af52aa641c62f8c0db789d9fc1970edb3eb6f9f59
MD5 162ce2cca835d11b78af42835bec7c54
BLAKE2b-256 c15016a77d8732bba4c5e9b9cb7531821e9b0604ea61c8bf91bbaa6ab89d62e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.14-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 6913b9353fe6328834f188462c8534894cf24549c7d32145c7a1604acdab2db0
MD5 5208f9a8c5eba9015239eab3ca6f1431
BLAKE2b-256 ac23e34d4d8b6882b47a9a6124d5c718c3e27a57dc40bf6471acd73f61e50e22

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.14-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 9.9 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.14-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 424e5b1b01f6733f2c6e317b3af8d200c593717e01064dddc7ebbac1df68dd89
MD5 0f619544e6d6434a90269c1745140fc1
BLAKE2b-256 08af41313035ea2b36f5c76bf1cae26f90e705c7d68eec56e5f2dc4d4fb5e962

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.14-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 be04714ff9ba4bb83709a8dd5c7caf73b6f172b4bd362c6a461dde184cf7ba47
MD5 cf80f5b9338aa96c07568d73d351b10d
BLAKE2b-256 3ff1b0dec9a92a536e483d5dcdec88748c77e64b3294d292a86cd5338f793daf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.14-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 fd3cb8638d4edd699bc284576b08a1e033717497415855b91035f610921dd18b
MD5 1760f3feb4ca563febf29a0204694896
BLAKE2b-256 e999cb531cf566d92da165bdeb27bb0964360166ab2c22c6177df630224901e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.14-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 9.9 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.14-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 88800ae0d1c9eeb7c43a255837824969ba9b4a95b0b886e9f0e0d90520277eec
MD5 92d7b7415da7de70a02b8abbcdce2b31
BLAKE2b-256 3c582b190e52243148ef0975d2c22855fffab9ec59ce1852d9cc638db575f496

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.14-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4d17e02d78c780be825fd7863b7610fb8a0817a348c9ce4b780a81b62004627a
MD5 9e06d439d6868a07a8e8cf681ce4046a
BLAKE2b-256 553c45a7b509297358a9145943fe916942324de328831d81fe3dbd84e9d82ce4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.14-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 119edc5f527acd562c97e6293ab2ea2069e40e8258b4473855527e3f43da7219
MD5 2c463e672faae7159844dcf700d261ed
BLAKE2b-256 c7ac654a5564f513b496eab95744bc19d10be9452fbf8d451be006d8798c7148

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.14-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 9.9 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.14-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ee8d25744fef9cc4899243fabe8a0c7c9dbc68a665768611b8cde46d53f163ba
MD5 60febcfe27b547022169b694a6575e7b
BLAKE2b-256 7c33da8655df697e0c0a1c262f251a9f9fe3610d23de59c854b26bc538a34b74

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.14-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e4f1b21c232424c718323b156a40eb4d306cbbf014e2f62cd1065028ac6217e1
MD5 c7240167b160d9bad53ea019f83b57fa
BLAKE2b-256 f87646ac6a72ed905a42f4c02a16679810abe702d69236cadd5c99876f1108b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.14-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 9.9 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.14-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 25e0b68b0b5d0185badef71bcd99038bcfcd0bb13f21529260cad79a11018fce
MD5 249270eb25ba030e287f305ebaac44c0
BLAKE2b-256 478143b24a941195cee568b33537e3d9c0a091de098a5438227858d9f4fb8c0b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.14-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 9221f068628fc451d2eae7a09f6b40fd461496d640aae7561ab004c18bf67f6e
MD5 aa11e6a51f2fb48ea97c0e36fb547ca2
BLAKE2b-256 ac40f6d0f456b0e742410aaecb8166ad5a1aea91bcabef38140dfbdf5a783ae6

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

0.0.9.15

17 files

This release

0.0.9.14 This release

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