Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
fa474bd0
提交
fa474bd0
authored
10月 17, 2014
作者:
Li
提交者:
Frederic
10月 21, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cosmatic changes
上级
ca90a876
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
4 行增加
和
13 行删除
+4
-13
function_module.py
theano/compile/function_module.py
+3
-12
test_pickle_unpickle_theano_fn.py
theano/tests/test_pickle_unpickle_theano_fn.py
+1
-1
没有找到文件。
theano/compile/function_module.py
浏览文件 @
fa474bd0
...
...
@@ -1221,15 +1221,12 @@ class FunctionMaker(object):
if
fgraph
is
None
:
need_opt
=
True
else
:
need_opt
=
False
if
fgraph
is
None
:
# make the fgraph (copies the graph, creates NEW INPUT AND OUTPUT VARIABLES)
fgraph
,
additional_outputs
=
std_fgraph
(
inputs
,
outputs
,
accept_inplace
)
fgraph
.
profile
=
profile
else
:
# fgraph is already an optimized one
need_opt
=
False
_
,
additional_outputs
=
std_fgraph
(
inputs
,
outputs
,
accept_inplace
)
pass
...
...
@@ -1239,11 +1236,10 @@ class FunctionMaker(object):
optimizer
,
linker
=
mode
.
optimizer
,
copy
.
copy
(
mode
.
linker
)
compute_test_value_orig
=
theano
.
config
.
compute_test_value
add_stack_trace_on_call
=
gof
.
Op
.
add_stack_trace_on_call
add_stack_trace_on_call
_orig
=
gof
.
Op
.
add_stack_trace_on_call
if
need_opt
:
# optimize the fgraph
try
:
theano
.
config
.
compute_test_value
=
theano
.
config
.
compute_test_value_opt
gof
.
Op
.
add_stack_trace_on_call
=
False
start_optimizer
=
time
.
time
()
...
...
@@ -1258,14 +1254,9 @@ class FunctionMaker(object):
#Add deep copy to respect the memory interface
insert_deepcopy
(
fgraph
,
inputs
,
outputs
+
additional_outputs
)
finally
:
theano
.
config
.
compute_test_value
=
compute_test_value_orig
gof
.
Op
.
add_stack_trace_on_call
=
add_stack_trace_on_call
else
:
# fgraph is already optimized
theano
.
config
.
compute_test_value
=
compute_test_value_orig
gof
.
Op
.
add_stack_trace_on_call
=
add_stack_trace_on_call
gof
.
Op
.
add_stack_trace_on_call
=
add_stack_trace_on_call_orig
# initialize the linker
if
not
hasattr
(
linker
,
'accept'
):
...
...
theano/tests/test_pickle_unpickle_theano_fn.py
浏览文件 @
fa474bd0
...
...
@@ -15,7 +15,7 @@ This note is written by Li Yao.
import
unittest
import
numpy
import
cPickle
from
collections
import
OrderedDict
from
theano.compat.python2x
import
DictMixin
,
OrderedDict
floatX
=
'float32'
import
theano
import
theano.tensor
as
T
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论