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

Uploaded CPython 3.13Windows x86-64

ivy-0.0.9.16-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.16-cp313-cp313-macosx_12_0_arm64.whl (23.0 MB view details)

Uploaded CPython 3.13macOS 12.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

ivy-0.0.9.16-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.16-cp312-cp312-macosx_12_0_arm64.whl (23.5 MB view details)

Uploaded CPython 3.12macOS 12.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

ivy-0.0.9.16-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.16-cp311-cp311-macosx_12_0_arm64.whl (23.8 MB view details)

Uploaded CPython 3.11macOS 12.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 12.0+ ARM64

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

Uploaded CPython 3.9Windows x86-64

ivy-0.0.9.16-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.16-cp38-cp38-win_amd64.whl (18.1 MB view details)

Uploaded CPython 3.8Windows x86-64

ivy-0.0.9.16-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.16.tar.gz.

File metadata

  • Download URL: ivy-0.0.9.16.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.16.tar.gz
Algorithm Hash digest
SHA256 1bcb26c525ec8d46b7b444ff5513061f158d5ea8be6366a4a676dcc1c0e9f75b
MD5 3d857dda259407cede9e304c642ac7aa
BLAKE2b-256 3a9915e673b72f71e9c10e1aea2ca8f44130796db96b38a23167a52ca0c7b3e8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.16-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.16-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ce5e7676a23c32be023e2631133c4dbc1aaf2c2455aa906e21065d1bc3ec05f9
MD5 5ba7b0af6d7ac795559740709a8b23ee
BLAKE2b-256 246ba7a1ddd551523d7609ff2dd78d08d483c2b36476680f65cd27e0472db51b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.16-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 74f817f0a39ebf56de9a365b09bb27e026cb31b6de5d7d77953c75de2ccb2858
MD5 21473f6447703ae9fac38c84107789d6
BLAKE2b-256 272b18b0c74a6a3954188f4573062ec3067bd97c88b85becefed1e2c7f210c2b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.16-cp313-cp313-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 b08d31812a46b12029fe4c3161da67919b72efbadb84d03efef86d1c8a313c90
MD5 e509a521bfbe5db6bf0323c779daaa78
BLAKE2b-256 3c0c72f9425af1a9e88184410d0571e251be5f60ff9e27861e48cffe51186d43

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.16-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.16-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 069688a9d9fcbd84c1ef73ba17ac7c95c04f80373ff57eeffa20870878b94838
MD5 94a4209a6b8204c58dfaedc930bdd729
BLAKE2b-256 e9831e435ea177f0036b05a01bed0a01d3cebf5a34cd52d84eb1c367a5332e8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.16-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 627620c3a9b1cbffdc9c6a1e78f0bac04add4e0615666ebbe4c3b92f0ce36f5a
MD5 4cb5863cf1766c1a4eb6f5a866f5b22a
BLAKE2b-256 a05e1fe7627f8ed8831e45bf6237d8d07d90aa7b53f9406bd0f8bffb4d57dbac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.16-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 99c21e87a4282d25e41e85ac552c7638e342fac27391f718385d688e79ac44e5
MD5 502d8c10c0fe7d76e3e2364b261bcc44
BLAKE2b-256 9d904e8f617b6524c4600dac8c03ae30ca23cbffd46ac504f8ce07427bfa8f19

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.16-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.16-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3fd6353eb31a2b33ccd934a48795a2a1bff725952b73a871286053788f038790
MD5 adfb8ecc750e6abeb2ef9292cbe08fa4
BLAKE2b-256 1e85fa56d5b148b9693492fa8ff4e8a3a24ff81d8fbbd6368fa45eb7b9b8f876

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.16-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8ccd227d246eab91eb4c2b72b3fda4113e06a22b23b62ea015beda1d8fa64544
MD5 f0bbdb5cc0f035d17c94e1fb88df84ec
BLAKE2b-256 7bb8ad406f8ddb81d486f5ea851306d3ab65d03f4a57f772a0864436d1a51372

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.16-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 d554566080b9fdaa69f2149c83ba9d61ad35e3364b544a16de25ae8578c08f09
MD5 07b10b9b2760b33778d3b07a363e7512
BLAKE2b-256 3c77f1665486586b1fc5ce62ce85a3a74691acaeebb7b3fd08d0e3ce8358dca4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.16-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.16-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6c0369d06b46a70483c55c6c5c445b127b02452707dece2384715518b00eb494
MD5 0fe89858f4b4a36930cb9423c56acd76
BLAKE2b-256 ace300557abef1772316cb758996f2086ae7000a902301a88d7b72c3cc5ed143

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.16-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 80399b84a261f420f5cd079eb836ac511d71309a063cf083278acec5e78909a2
MD5 913daf3508efa4264b1aec6e1b1b2ed1
BLAKE2b-256 eb711c786f4304f3147bdcaf23df70010f131361608920dd88c072cdb521f1c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.16-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 b7b0ef2f3803eef5a03e3976b48d2f99aea519072ce15d1addded287aa8acbec
MD5 5975b2345b6ed779b176853ad98583de
BLAKE2b-256 6513b268e374e4126924737aa5414963b17fb9a83679c94ae871e8e962601e33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.16-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.16-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e5c10973dee585d8c578f01f389d314430694ed12f5c7f9a189dbb559e7457b7
MD5 c1fa1db0d6ff8d25242308943c080da4
BLAKE2b-256 1dc34e78c1e2c111d462fdbdbf7791584f126cdf094be497b75fbf42c633abff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.16-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 79bd05f5cb5f0acc37f355b464961dfcc2ef19889a60f4949fe3b7285c4df1ed
MD5 57b41ecff7fc14713e0c019cda9a2bc4
BLAKE2b-256 1cf9bfba0686a3b79d44637689678bb4f5dc86d79282d95c2aaeb102852b0923

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy-0.0.9.16-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.16-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e95a4201b68d9e7b70ebac0947e120a8fce26e08687e78350a169d0996e0f885
MD5 a4840a083609cb7cd191c27359503564
BLAKE2b-256 069c712823c76d6730f2fe56453f456ffa4a22505a5684082d046c142c5bab50

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ivy-0.0.9.16-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8287b0e0af12e50ca206f359ca8a6d0338973e65c37f2845ed8e355fb4ad9bab
MD5 addd16e12d953960204deadb7dc81bb7
BLAKE2b-256 d349b0706f40594e00032c9658169fdc3e26eaabbc971535b0182c00d06d17e8

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

This release

0.0.9.16 This release

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