Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d44c7f33
提交
d44c7f33
authored
1月 29, 2010
作者:
James Bergstra
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
s/stderr/stdout (in most cases) in cuda tests
上级
5ce32c02
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
18 行增加
和
18 行删除
+18
-18
test_basic_ops.py
theano/sandbox/cuda/tests/test_basic_ops.py
+7
-7
test_conv_cuda_ndarray.py
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
+1
-1
test_cuda_ndarray.py
theano/sandbox/cuda/tests/test_cuda_ndarray.py
+10
-10
没有找到文件。
theano/sandbox/cuda/tests/test_basic_ops.py
浏览文件 @
d44c7f33
...
@@ -140,20 +140,20 @@ def test_elemwise1():
...
@@ -140,20 +140,20 @@ def test_elemwise1():
b
=
tensor
.
fmatrix
()
b
=
tensor
.
fmatrix
()
#let debugmode catch any mistakes
#let debugmode catch any mistakes
print
>>
sys
.
std
err
,
"STARTING FUNCTION 1"
print
>>
sys
.
std
out
,
"STARTING FUNCTION 1"
f
=
pfunc
([
b
],
[],
updates
=
[(
a
,
b
**
a
)],
mode
=
mode_with_gpu
)
f
=
pfunc
([
b
],
[],
updates
=
[(
a
,
b
**
a
)],
mode
=
mode_with_gpu
)
for
i
,
node
in
enumerate
(
f
.
maker
.
env
.
toposort
()):
for
i
,
node
in
enumerate
(
f
.
maker
.
env
.
toposort
()):
print
i
,
node
print
i
,
node
f
(
numpy
.
random
.
rand
(
*
shape
)
+
0.3
)
f
(
numpy
.
random
.
rand
(
*
shape
)
+
0.3
)
print
>>
sys
.
std
err
,
"STARTING FUNCTION 2"
print
>>
sys
.
std
out
,
"STARTING FUNCTION 2"
#let debugmode catch any mistakes
#let debugmode catch any mistakes
f
=
pfunc
([
b
],
[],
updates
=
[(
a
,
tensor
.
exp
(
b
**
a
))],
mode
=
mode_with_gpu
)
f
=
pfunc
([
b
],
[],
updates
=
[(
a
,
tensor
.
exp
(
b
**
a
))],
mode
=
mode_with_gpu
)
for
i
,
node
in
enumerate
(
f
.
maker
.
env
.
toposort
()):
for
i
,
node
in
enumerate
(
f
.
maker
.
env
.
toposort
()):
print
i
,
node
print
i
,
node
f
(
numpy
.
random
.
rand
(
*
shape
)
+
0.3
)
f
(
numpy
.
random
.
rand
(
*
shape
)
+
0.3
)
print
>>
sys
.
std
err
,
"STARTING FUNCTION 3"
print
>>
sys
.
std
out
,
"STARTING FUNCTION 3"
#let debugmode catch any mistakes
#let debugmode catch any mistakes
f
=
pfunc
([
b
],
[],
updates
=
[(
a
,
a
+
b
*
tensor
.
exp
(
b
**
a
))],
mode
=
mode_with_gpu
)
f
=
pfunc
([
b
],
[],
updates
=
[(
a
,
a
+
b
*
tensor
.
exp
(
b
**
a
))],
mode
=
mode_with_gpu
)
f
(
numpy
.
random
.
rand
(
*
shape
)
+
0.3
)
f
(
numpy
.
random
.
rand
(
*
shape
)
+
0.3
)
...
@@ -169,11 +169,11 @@ def test_elemwise2():
...
@@ -169,11 +169,11 @@ def test_elemwise2():
f
=
pfunc
([
b
],
[],
updates
=
[(
a
,
(
a
+
b
)
.
dimshuffle
(
pattern
))],
mode
=
mode_with_gpu
)
f
=
pfunc
([
b
],
[],
updates
=
[(
a
,
(
a
+
b
)
.
dimshuffle
(
pattern
))],
mode
=
mode_with_gpu
)
has_elemwise
=
False
has_elemwise
=
False
for
i
,
node
in
enumerate
(
f
.
maker
.
env
.
toposort
()):
for
i
,
node
in
enumerate
(
f
.
maker
.
env
.
toposort
()):
print
>>
sys
.
std
err
,
i
,
node
print
>>
sys
.
std
out
,
i
,
node
has_elemwise
=
has_elemwise
or
isinstance
(
node
.
op
,
tensor
.
Elemwise
)
has_elemwise
=
has_elemwise
or
isinstance
(
node
.
op
,
tensor
.
Elemwise
)
assert
not
has_elemwise
assert
not
has_elemwise
#let debugmode catch errors
#let debugmode catch errors
print
>>
sys
.
std
err
,
'pattern'
,
pattern
print
>>
sys
.
std
out
,
'pattern'
,
pattern
f
(
rng
.
rand
(
*
shape
)
*.
3
)
f
(
rng
.
rand
(
*
shape
)
*.
3
)
shape
=
(
3
,
4
,
5
,
6
)
shape
=
(
3
,
4
,
5
,
6
)
...
@@ -204,7 +204,7 @@ def test_elemwise3():
...
@@ -204,7 +204,7 @@ def test_elemwise3():
b
**
a
)
.
dimshuffle
([
2
,
0
,
3
,
1
]))],
mode
=
mode_with_gpu
)
b
**
a
)
.
dimshuffle
([
2
,
0
,
3
,
1
]))],
mode
=
mode_with_gpu
)
has_elemwise
=
False
has_elemwise
=
False
for
i
,
node
in
enumerate
(
f
.
maker
.
env
.
toposort
()):
for
i
,
node
in
enumerate
(
f
.
maker
.
env
.
toposort
()):
print
>>
sys
.
std
err
,
i
,
node
print
>>
sys
.
std
out
,
i
,
node
has_elemwise
=
has_elemwise
or
isinstance
(
node
.
op
,
tensor
.
Elemwise
)
has_elemwise
=
has_elemwise
or
isinstance
(
node
.
op
,
tensor
.
Elemwise
)
assert
not
has_elemwise
assert
not
has_elemwise
#let debugmode catch errors
#let debugmode catch errors
...
@@ -220,7 +220,7 @@ def test_elemwise4():
...
@@ -220,7 +220,7 @@ def test_elemwise4():
f
=
pfunc
([
b
,
c
],
[],
updates
=
[(
a
,
(
a
+
b
.
dimshuffle
(
'x'
,
0
)
*
c
.
dimshuffle
(
0
,
'x'
)))],
mode
=
mode_with_gpu
)
f
=
pfunc
([
b
,
c
],
[],
updates
=
[(
a
,
(
a
+
b
.
dimshuffle
(
'x'
,
0
)
*
c
.
dimshuffle
(
0
,
'x'
)))],
mode
=
mode_with_gpu
)
has_elemwise
=
False
has_elemwise
=
False
for
i
,
node
in
enumerate
(
f
.
maker
.
env
.
toposort
()):
for
i
,
node
in
enumerate
(
f
.
maker
.
env
.
toposort
()):
print
>>
sys
.
std
err
,
i
,
node
print
>>
sys
.
std
out
,
i
,
node
has_elemwise
=
has_elemwise
or
isinstance
(
node
.
op
,
tensor
.
Elemwise
)
has_elemwise
=
has_elemwise
or
isinstance
(
node
.
op
,
tensor
.
Elemwise
)
assert
not
has_elemwise
assert
not
has_elemwise
#let debugmode catch errors
#let debugmode catch errors
...
...
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
浏览文件 @
d44c7f33
...
@@ -360,7 +360,7 @@ def test_subsample():
...
@@ -360,7 +360,7 @@ def test_subsample():
def
test_logical_shapes
():
def
test_logical_shapes
():
# implement when
# implement when
print
>>
sys
.
stderr
,
"
INF
O: test_logical_shapes not implemented (i.e. imshp_logical, kshp_logical, kshp_logical_top_aligned)"
print
>>
sys
.
stderr
,
"
WARNING TOD
O: test_logical_shapes not implemented (i.e. imshp_logical, kshp_logical, kshp_logical_top_aligned)"
def
_test_dummy
():
def
_test_dummy
():
...
...
theano/sandbox/cuda/tests/test_cuda_ndarray.py
浏览文件 @
d44c7f33
...
@@ -8,7 +8,7 @@ if cuda_ndarray.enable_cuda == False:
...
@@ -8,7 +8,7 @@ if cuda_ndarray.enable_cuda == False:
import
numpy
import
numpy
def
test_host_to_device
():
def
test_host_to_device
():
print
>>
sys
.
std
err
,
'starting test_host_to_dev'
print
>>
sys
.
std
out
,
'starting test_host_to_dev'
for
shape
in
((),
(
3
,),
(
2
,
3
),
(
3
,
4
,
5
,
6
)):
for
shape
in
((),
(
3
,),
(
2
,
3
),
(
3
,
4
,
5
,
6
)):
a
=
theano
.
_asarray
(
numpy
.
random
.
rand
(
*
shape
),
dtype
=
'float32'
)
a
=
theano
.
_asarray
(
numpy
.
random
.
rand
(
*
shape
),
dtype
=
'float32'
)
b
=
cuda_ndarray
.
CudaNdarray
(
a
)
b
=
cuda_ndarray
.
CudaNdarray
(
a
)
...
@@ -53,7 +53,7 @@ def test_add():
...
@@ -53,7 +53,7 @@ def test_add():
def
test_exp
():
def
test_exp
():
print
>>
sys
.
std
err
,
'starting test_exp'
print
>>
sys
.
std
out
,
'starting test_exp'
for
shape
in
((),
(
3
,),
(
2
,
3
),
(
1
,
10000000
),(
10
,
1000000
),
(
100
,
100000
),(
1000
,
10000
),(
10000
,
1000
)):
for
shape
in
((),
(
3
,),
(
2
,
3
),
(
1
,
10000000
),(
10
,
1000000
),
(
100
,
100000
),(
1000
,
10000
),(
10000
,
1000
)):
a0
=
theano
.
_asarray
(
numpy
.
random
.
rand
(
*
shape
),
dtype
=
'float32'
)
a0
=
theano
.
_asarray
(
numpy
.
random
.
rand
(
*
shape
),
dtype
=
'float32'
)
a1
=
a0
.
copy
()
a1
=
a0
.
copy
()
...
@@ -74,25 +74,25 @@ def test_exp():
...
@@ -74,25 +74,25 @@ def test_exp():
def
test_copy
():
def
test_copy
():
print
>>
sys
.
std
err
,
'starting test_copy'
print
>>
sys
.
std
out
,
'starting test_copy'
shape
=
(
5
,)
shape
=
(
5
,)
a
=
theano
.
_asarray
(
numpy
.
random
.
rand
(
*
shape
),
dtype
=
'float32'
)
a
=
theano
.
_asarray
(
numpy
.
random
.
rand
(
*
shape
),
dtype
=
'float32'
)
print
>>
sys
.
std
err
,
'.. creating device object'
print
>>
sys
.
std
out
,
'.. creating device object'
b
=
cuda_ndarray
.
CudaNdarray
(
a
)
b
=
cuda_ndarray
.
CudaNdarray
(
a
)
print
>>
sys
.
std
err
,
'.. copy'
print
>>
sys
.
std
out
,
'.. copy'
c
=
copy
.
copy
(
b
)
c
=
copy
.
copy
(
b
)
print
>>
sys
.
std
err
,
'.. deepcopy'
print
>>
sys
.
std
out
,
'.. deepcopy'
d
=
copy
.
deepcopy
(
b
)
d
=
copy
.
deepcopy
(
b
)
print
>>
sys
.
std
err
,
'.. comparisons'
print
>>
sys
.
std
out
,
'.. comparisons'
assert
numpy
.
allclose
(
a
,
numpy
.
asarray
(
b
))
assert
numpy
.
allclose
(
a
,
numpy
.
asarray
(
b
))
assert
numpy
.
allclose
(
a
,
numpy
.
asarray
(
c
))
assert
numpy
.
allclose
(
a
,
numpy
.
asarray
(
c
))
assert
numpy
.
allclose
(
a
,
numpy
.
asarray
(
d
))
assert
numpy
.
allclose
(
a
,
numpy
.
asarray
(
d
))
def
test_dot
():
def
test_dot
():
print
>>
sys
.
std
err
,
'starting test_dot'
print
>>
sys
.
std
out
,
'starting test_dot'
a0
=
theano
.
_asarray
(
numpy
.
random
.
rand
(
4
,
7
),
dtype
=
'float32'
)
a0
=
theano
.
_asarray
(
numpy
.
random
.
rand
(
4
,
7
),
dtype
=
'float32'
)
a1
=
theano
.
_asarray
(
numpy
.
random
.
rand
(
7
,
6
),
dtype
=
'float32'
)
a1
=
theano
.
_asarray
(
numpy
.
random
.
rand
(
7
,
6
),
dtype
=
'float32'
)
...
@@ -101,7 +101,7 @@ def test_dot():
...
@@ -101,7 +101,7 @@ def test_dot():
assert
numpy
.
allclose
(
numpy
.
dot
(
a0
,
a1
),
cuda_ndarray
.
dot
(
b0
,
b1
))
assert
numpy
.
allclose
(
numpy
.
dot
(
a0
,
a1
),
cuda_ndarray
.
dot
(
b0
,
b1
))
print
>>
sys
.
stderr
,
'WARNING test_dot: not testing all 8 transpose cases of dot'
print
>>
sys
.
stderr
,
'WARNING
TODO
test_dot: not testing all 8 transpose cases of dot'
def
test_sum
():
def
test_sum
():
shape
=
(
2
,
3
)
shape
=
(
2
,
3
)
...
@@ -147,7 +147,7 @@ def test_reshape():
...
@@ -147,7 +147,7 @@ def test_reshape():
]
]
def
subtest
(
shape_1
,
shape_2
):
def
subtest
(
shape_1
,
shape_2
):
#print >> sys.std
err
, "INFO: shapes", shape_1, shape_2
#print >> sys.std
out
, "INFO: shapes", shape_1, shape_2
a
=
theano
.
_asarray
(
numpy
.
random
.
rand
(
*
shape_1
),
dtype
=
'float32'
)
a
=
theano
.
_asarray
(
numpy
.
random
.
rand
(
*
shape_1
),
dtype
=
'float32'
)
b
=
cuda_ndarray
.
CudaNdarray
(
a
)
b
=
cuda_ndarray
.
CudaNdarray
(
a
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论