Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5b2cb6f4
提交
5b2cb6f4
authored
11月 22, 2010
作者:
Razvan Pascanu
浏览文件
操作
浏览文件
下载
差异文件
merge
上级
0c84c369
fa55c51b
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
34 行增加
和
25 行删除
+34
-25
test_tutorial.py
theano/tests/test_tutorial.py
+34
-25
没有找到文件。
theano/tests/test_tutorial.py
浏览文件 @
5b2cb6f4
...
...
@@ -5,6 +5,7 @@ from theano import function
import
numpy
from
numpy
import
array
from
numpy.testing
import
dec
from
theano
import
config
from
theano.tests
import
unittest_tools
as
utt
...
...
@@ -162,8 +163,14 @@ class T_extending(unittest.TestCase):
fn
=
lambda
x
,
y
:
x
/
y
)
@dec.knownfailureif
(
isinstance
(
theano
.
compile
.
mode
.
get_default_mode
(),
theano
.
compile
.
debugmode
.
DebugMode
),
"This test fail in DEBUG_MODE but this don't make theano generate some bad code. It is a trouble with DEBUG_MODE"
)
def
test_extending_2
(
self
):
'''
This test fails in DebugMode for the same reasons the test in
tensor/tests/test_basic.py:T_scalarfromtensor.test0
fails on debug mode ( as much as I could tell - Razvan )
'''
from
theano
import
gof
class
Double
(
gof
.
Type
):
...
...
@@ -699,29 +706,31 @@ class T_loading_and_saving(unittest.TestCase):
my_obj
=
theano
.
function
([
theano
.
In
(
x
,
borrow
=
True
)]
,
theano
.
Out
(
y
,
borrow
=
True
))
f
=
file
(
'obj.save'
,
'wb'
)
cPickle
.
dump
(
my_obj
,
f
,
protocol
=
cPickle
.
HIGHEST_PROTOCOL
)
f
.
close
()
mode_instance
=
theano
.
compile
.
mode
.
get_mode
(
None
)
if
not
isinstance
(
mode_instance
,
theano
.
compile
.
debugmode
.
DebugMode
):
f
=
file
(
'obj.save'
,
'wb'
)
cPickle
.
dump
(
my_obj
,
f
,
protocol
=
cPickle
.
HIGHEST_PROTOCOL
)
f
.
close
()
f
=
file
(
'obj.save'
,
'rb'
)
loaded_obj
=
cPickle
.
load
(
f
)
f
.
close
()
f
=
file
(
'obj.save'
,
'rb'
)
loaded_obj
=
cPickle
.
load
(
f
)
f
.
close
()
obj1
=
my_obj
obj2
=
my_obj
obj3
=
my_obj
obj1
=
my_obj
obj2
=
my_obj
obj3
=
my_obj
f
=
file
(
'objects.save'
,
'wb'
)
for
obj
in
[
obj1
,
obj2
,
obj3
]:
cPickle
.
dump
(
obj
,
f
,
protocol
=
cPickle
.
HIGHEST_PROTOCOL
)
f
.
close
()
f
=
file
(
'objects.save'
,
'wb'
)
for
obj
in
[
obj1
,
obj2
,
obj3
]:
cPickle
.
dump
(
obj
,
f
,
protocol
=
cPickle
.
HIGHEST_PROTOCOL
)
f
.
close
()
f
=
file
(
'objects.save'
,
'rb'
)
loaded_objects
=
[]
for
i
in
range
(
3
):
loaded_objects
.
append
(
cPickle
.
load
(
f
))
f
.
close
()
f
=
file
(
'objects.save'
,
'rb'
)
loaded_objects
=
[]
for
i
in
range
(
3
):
loaded_objects
.
append
(
cPickle
.
load
(
f
))
f
.
close
()
class
T_modes
(
unittest
.
TestCase
):
...
...
@@ -754,8 +763,8 @@ class T_using_gpu(unittest.TestCase):
import
numpy
import
time
vlen
=
10
*
30
*
7
68
# 10 x #cores x # threads per core
iters
=
10
00
vlen
=
10
*
30
*
7
0
# 10 x #cores x # threads per core
iters
=
10
rng
=
numpy
.
random
.
RandomState
(
22
)
x
=
shared
(
numpy
.
asarray
(
rng
.
rand
(
vlen
),
config
.
floatX
))
...
...
@@ -782,8 +791,8 @@ class T_using_gpu(unittest.TestCase):
import
numpy
import
time
vlen
=
10
*
30
*
7
68
# 10 x #cores x # threads per core
iters
=
10
00
vlen
=
10
*
30
*
7
0
# 10 x #cores x # threads per core
iters
=
10
rng
=
numpy
.
random
.
RandomState
(
22
)
x
=
shared
(
numpy
.
asarray
(
rng
.
rand
(
vlen
),
config
.
floatX
))
...
...
@@ -811,8 +820,8 @@ class T_using_gpu(unittest.TestCase):
import
numpy
import
time
vlen
=
10
*
30
*
7
68
# 10 x #cores x # threads per core
iters
=
10
00
vlen
=
10
*
30
*
7
0
# 10 x #cores x # threads per core
iters
=
10
rng
=
numpy
.
random
.
RandomState
(
22
)
x
=
shared
(
numpy
.
asarray
(
rng
.
rand
(
vlen
),
config
.
floatX
))
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论