Skip to main content

A multi-language library for translating commands between PyTorch, TensorFlow, and TensorFlow.js

Project description

Tests License OpenCollective

Threepio Python Client

Threepio is a multi-language library for translating commands between PyTorch, TensorFlow, and TensorFlow.js This section of the code-base is for the Python Client.

Installation

Use the package manager pip to install threepio.

pip install openmined.threepio

Usage

import tensorflow as tf
from pythreepio import Threepio, Command

# Create a threepio translating from pytorch -> tensorflow python
threepio = Threepio("torch", "tf", tf)

# Create your command to translate
args = [
    tf.constant([[1, 0], [0, 1]]),
    tf.constant([[0, 1], [1, 0]])
]
kwargs = {}
cmd = Command("add", args, kwargs)

# Translate the command
translated_cmd = threepio.translate(cmd, lookup_command=True)

...

# When you're ready, execute the translation
translated_cmd.execute_routine() # -> [[1, 1], [1, 1]]

Command Support

Support for commands is currently limited. Officially supported commands are listed in our tests.

Project details


Download files

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

Source Distribution

openmined.threepio-0.0.1.tar.gz (73.5 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page