Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
77a1dbb4
提交
77a1dbb4
authored
7月 06, 2017
作者:
notoraptor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove get_op_params() from public COp interface.
上级
ffb2d4fa
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
7 行增加
和
4 行删除
+7
-4
op.py
theano/gof/op.py
+7
-4
没有找到文件。
theano/gof/op.py
浏览文件 @
77a1dbb4
...
@@ -1388,11 +1388,10 @@ class COp(Op):
...
@@ -1388,11 +1388,10 @@ class COp(Op):
raise
ValueError
(
"No valid section marker was found in file "
raise
ValueError
(
"No valid section marker was found in file "
"
%
s"
%
func_files
[
i
])
"
%
s"
%
func_files
[
i
])
def
get_op_params
(
self
):
def
__
get_op_params
(
self
):
"""
"""
Returns a list of (name, value) pairs that will be turned into
Returns a list of (name, value) pairs that will be turned into
macros for use within the op code. This is intended to allow
macros for use within the op code.
an op's properties to influence the generated C code.
The names must be strings that are not a C keyword and the
The names must be strings that are not a C keyword and the
values must be strings of literal C representations.
values must be strings of literal C representations.
...
@@ -1412,6 +1411,10 @@ class COp(Op):
...
@@ -1412,6 +1411,10 @@ class COp(Op):
params
=
[(
'PARAMS_TYPE'
,
wrapper
.
name
)]
params
=
[(
'PARAMS_TYPE'
,
wrapper
.
name
)]
for
i
in
range
(
wrapper
.
length
):
for
i
in
range
(
wrapper
.
length
):
try
:
try
:
# NB (reminder): These macros are currently used only in ParamsType example test
# (`theano/gof/tests/test_quadratic_function.c`), to demonstrate how we can
# access params dtypes when dtypes may change (e.g. if based on theano.config.floatX).
# But in practice, params types generally have fixed types per op.
params
.
append
((
'DTYPE_PARAM_'
+
wrapper
.
fields
[
i
],
wrapper
.
types
[
i
]
.
c_element_type
()))
params
.
append
((
'DTYPE_PARAM_'
+
wrapper
.
fields
[
i
],
wrapper
.
types
[
i
]
.
c_element_type
()))
except
utils
.
MethodNotDefined
:
except
utils
.
MethodNotDefined
:
pass
pass
...
@@ -1506,7 +1509,7 @@ class COp(Op):
...
@@ -1506,7 +1509,7 @@ class COp(Op):
"str##_
%
s"
%
name
))
"str##_
%
s"
%
name
))
undef_macros
.
append
(
undef_template
%
"APPLY_SPECIFIC"
)
undef_macros
.
append
(
undef_template
%
"APPLY_SPECIFIC"
)
for
n
,
v
in
self
.
get_op_params
():
for
n
,
v
in
self
.
__
get_op_params
():
define_macros
.
append
(
define_template
%
(
n
,
v
))
define_macros
.
append
(
define_template
%
(
n
,
v
))
undef_macros
.
append
(
undef_template
%
(
n
,))
undef_macros
.
append
(
undef_template
%
(
n
,))
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论