一个用于在PyTorch、TensorFlow和TensorFlow.js之间翻译命令的多语言库
项目描述
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 查看哈希值)
关闭
openmined.threepio-0.2.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 3071627665b1b22ca3faa3f036e498d037c1879b61f8055a798cad4e23d4ee6d |
|
MD5 | 528d5aae516aa6f7904297fe002ac495 |
|
BLAKE2b-256 | 0a38df6367693c7f3808f076cd8c2647c434a04adda2bbb2435dadefe7258fd4 |