2 Star 6 Fork 7

mirrors_Qihoo360/tensornet

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
tf_gen_op_wrapper.py 618 Bytes
一键复制 编辑 原始数据 按行查看 历史
James Z.M. Gao 提交于 2025-03-13 14:08 +08:00 . build with cmake
#!/usr/bin/env python3
import sys
from tensorflow.python import _pywrap_python_op_gen
from tensorflow.python.client import pywrap_tf_session as py_tf
lib_file = sys.argv[1]
lib_handle = py_tf.TF_LoadLibrary(lib_file)
lib_ops = py_tf.TF_GetOpList(lib_handle)
wrapper_codes = _pywrap_python_op_gen.GetPythonWrappers(lib_ops).decode()
source_files = sys.argv[2:]
if source_files:
marker = "This file is MACHINE GENERATED! Do not edit."
source_line = f"Original C++ source file: {', '.join(source_files)}"
wrapper_codes = wrapper_codes.replace(marker, f"{marker}\n{source_line}", 1)
print(wrapper_codes)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/mirrors_Qihoo360/tensornet.git
git@gitee.com:mirrors_Qihoo360/tensornet.git
mirrors_Qihoo360
tensornet
tensornet
master

搜索帮助