Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleHub
提交
a7967cef
P
PaddleHub
项目概览
PaddlePaddle
/
PaddleHub
12 个月 前同步成功
通知
280
Star
12117
Fork
2091
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
200
列表
看板
标记
里程碑
合并请求
4
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleHub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
200
Issue
200
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a7967cef
编写于
1月 15, 2019
作者:
Z
Zeyu Chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove module.py deprecated code
上级
97a0781d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
101 deletion
+0
-101
paddle_hub/module.py
paddle_hub/module.py
+0
-101
未找到文件。
paddle_hub/module.py
浏览文件 @
a7967cef
...
...
@@ -140,85 +140,6 @@ class Module(object):
return
self
.
feed_target_names
,
self
.
fetch_targets
,
program
# @deprecated
# def get_vars(self):
# """
# Return variable list of the module program
# """
# return self.inference_program.list_vars()
# @deprecated
# def get_feed_var(self, key, signature="default"):
# """
# Get feed variable according to variable key and signature
# """
# for var in self.inference_program.list_vars():
# if var.name == self.config.feed_var_name(key, signature):
# return var
# raise Exception("Can't find input var {}".format(key))
# @deprecated
# def get_feed_var_by_index(self, index, signature="default"):
# feed_vars = self.get_feed_vars(signature)
# assert index < len(
# feed_vars), "index out of range index {}, len {}".format(
# index, len(feed_vars))
# return feed_vars[index]
# @deprecated
# def get_fetch_var_by_index(self, index, signature="default"):
# fetch_vars = self.get_fetch_vars(signature)
# assert index < len(
# fetch_vars), "index out of range index {}, len {}".format(
# index, len(fetch_vars))
# return fetch_vars[index]
# @deprecated
# def get_feed_vars(self, signature="default"):
# """
# Get feed variable according to variable key and signature
# """
# feed_vars = []
# for feed_var in self.config.feed_var_names(signature):
# find_var = False
# for var in self.inference_program.list_vars():
# if var.name == feed_var.var_name:
# feed_vars.append(var)
# find_var = True
# if not find_var:
# raise Exception("Can't find feed var {}".format(feed_var_name))
# return feed_vars
# @deprecated
# def get_fetch_vars(self, signature="default"):
# """
# Get feed variable according to variable key and signature
# """
# fetch_vars = []
# #TODO(ZeyuChen): use brute force to find variables, simple and easy to
# #understand
# for fetch_var in self.config.fetch_var_names(signature):
# find_var = False
# for var in self.inference_program.list_vars():
# if var.name == fetch_var.var_name:
# fetch_vars.append(var)
# find_var = True
# if not find_var:
# raise Exception("Can't find feed var {}".format(fetch_var_name))
# return fetch_vars
# @deprecated
# def get_fetch_var(self, key, signature="default"):
# """
# Get fetch variable according to variable key and signature
# """
# for var in self.inference_program.list_vars():
# if var.name == self.config.fetch_var_name(key, signature):
# return var
def
get_inference_program
(
self
):
return
self
.
inference_program
...
...
@@ -303,28 +224,6 @@ class ModuleConfig(object):
for
w
in
word_dict
:
self
.
dict
[
w
]
=
word_dict
[
w
]
def
feed_var_names
(
self
,
sign_name
=
"default"
):
return
self
.
desc
.
sign2var
[
sign_name
].
feed_desc
def
fetch_var_names
(
self
,
sign_name
=
"default"
):
return
self
.
desc
.
sign2var
[
sign_name
].
fetch_desc
def
feed_var_name
(
self
,
key
,
sign_name
=
"default"
):
"""get module's feed/input variable name
"""
for
desc
in
self
.
desc
.
sign2var
[
sign_name
].
feed_desc
:
if
desc
.
key
==
key
:
return
desc
.
var_name
raise
Exception
(
"feed variable {} not found"
.
format
(
key
))
def
fetch_var_name
(
self
,
key
,
sign_name
=
"default"
):
"""get module's fetch/output variable name
"""
for
desc
in
self
.
desc
.
sign2var
[
sign_name
].
fetch_desc
:
if
desc
.
key
==
key
:
return
desc
.
var_name
raise
Exception
(
"fetch variable {} not found"
.
format
(
key
))
@
staticmethod
def
module_desc_path
(
module_dir
):
return
os
.
path
.
join
(
module_dir
,
MODULE_DESC_PBNAME
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录