Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
86a5eefe
提交
86a5eefe
authored
2月 13, 2015
作者:
Lijun Xue
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update test files
上级
130e6464
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
56 行增加
和
45 行删除
+56
-45
test_profiling.py
theano/compile/tests/test_profiling.py
+1
-2
test_reallocation.py
theano/gof/tests/test_reallocation.py
+55
-0
test_reduce_allocation.py
theano/gof/tests/test_reduce_allocation.py
+0
-43
没有找到文件。
theano/compile/tests/test_profiling.py
浏览文件 @
86a5eefe
...
...
@@ -107,5 +107,4 @@ class Test_profiling(unittest.TestCase):
if
__name__
==
'__main__'
:
Test_profiling
.
test_profiling
()
Test_profiling
.
test_ifelse
()
unittest
.
main
()
theano/gof/tests/test_reallocation.py
0 → 100644
浏览文件 @
86a5eefe
"Test of reduce allocation"
import
unittest
import
theano
import
theano.tensor
as
T
class
Test_reallocation
(
unittest
.
TestCase
):
"""
Test of Theano reallocation
"""
def
test_reallocation
(
self
):
pre_config
=
theano
.
config
.
allow_gc
try
:
theano
.
config
.
allow_gc
=
False
x
=
T
.
scalar
(
'x'
)
y
=
T
.
scalar
(
'y'
)
z
=
T
.
tanh
(
x
+
y
)
+
T
.
cosh
(
x
+
y
)
if
theano
.
config
.
mode
in
[
"DebugMode"
,
"DEBUG_MODE"
,
"FAST_COMPILE"
]:
m
=
"FAST_RUN"
else
:
m
=
None
m
=
theano
.
compile
.
get_mode
(
m
)
.
excluding
(
'fusion'
,
'inplace'
)
f
=
theano
.
function
([
x
,
y
],
z
,
name
=
"test_reduce_memory"
,
mode
=
m
)
output
=
f
(
1
,
2
)
storage_map
=
f
.
fn
.
storage_map
def
check_storage
(
storage_map
):
for
i
in
storage_map
.
keys
():
keys_copy
=
storage_map
.
keys
()[:]
keys_copy
.
remove
(
i
)
for
o
in
keys_copy
:
if
storage_map
[
i
][
0
]
==
storage_map
[
o
][
0
]:
return
True
return
False
assert
check_storage
(
storage_map
)
finally
:
theano
.
config
.
allow_gc
=
pre_config
if
__name__
==
"__main__"
:
unittest
.
main
()
theano/gof/tests/test_reduce_allocation.py
deleted
100644 → 0
浏览文件 @
130e6464
import
StringIO
import
numpy
import
theano
import
theano.tensor
as
T
from
theano.ifelse
import
ifelse
def
test_reduce
():
config1
=
theano
.
config
.
profile
config2
=
theano
.
config
.
profile_memory
try
:
theano
.
config
.
profile
=
True
theano
.
config
.
profile_memory
=
True
theano
.
config
.
profiling
.
min_peak_memory
=
True
x
=
T
.
scalar
(
'x'
)
y
=
T
.
scalar
(
'y'
)
z
=
5
*
y
+
x
**
2
+
y
**
3
-
4
*
x
p
=
theano
.
ProfileStats
(
False
)
if
theano
.
config
.
mode
in
[
"DebugMode"
,
"DEBUG_MODE"
,
"FAST_COMPILE"
]:
m
=
"FAST_RUN"
else
:
m
=
None
m
=
theano
.
compile
.
get_mode
(
m
)
.
excluding
(
'fusion'
,
'inplace'
)
f
=
theano
.
function
([
x
,
y
],
z
,
profile
=
p
,
name
=
"test_profiling"
,
mode
=
m
)
out
=
f
(
1
,
2
)
finally
:
theano
.
config
.
profile
=
config1
theano
.
config
.
profile_memory
=
config2
if
__name__
==
"__main__"
:
test_reduce
()
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论