跳转到主要内容

一个用于在PyTorch、TensorFlow和TensorFlow.js之间翻译命令的多语言库

项目描述

Tests License OpenCollective

Threepio Python客户端

Threepio是一个用于在PyTorch、TensorFlow和TensorFlow.js之间翻译命令的多语言库。本节代码库是为Python客户端编写的。

安装

使用包管理器pip安装threepio。

pip install openmined.threepio

用法

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]]

命令支持

目前对命令的支持有限。官方支持的命令列在我们测试中。

项目详情


下载文件

下载适合您平台的应用程序。如果您不确定该选择哪一个,请了解更多关于安装软件包的信息。

源代码分布

openmined.threepio-0.2.0.tar.gz (73.5 kB 查看哈希值)

上传时间: 源代码

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面