Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5c826bdc
提交
5c826bdc
authored
4月 12, 2010
作者:
fsavard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Bug in GpuJoin. Removing optimization until solved
上级
170abace
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
19 行增加
和
9 行删除
+19
-9
opt.py
theano/sandbox/cuda/opt.py
+1
-1
test_opt.py
theano/sandbox/cuda/tests/test_opt.py
+4
-2
rng_mrg.py
theano/sandbox/rng_mrg.py
+14
-6
没有找到文件。
theano/sandbox/cuda/opt.py
浏览文件 @
5c826bdc
...
@@ -499,7 +499,7 @@ def local_gpu_join(node):
...
@@ -499,7 +499,7 @@ def local_gpu_join(node):
not implemented yet.
not implemented yet.
"""
"""
if
isinstance
(
node
.
op
,
tensor
.
Join
):
if
False
and
isinstance
(
node
.
op
,
tensor
.
Join
):
# optimizing this case:
# optimizing this case:
# join(host_from_gpu) -> host_from_gpu(gpu_join)
# join(host_from_gpu) -> host_from_gpu(gpu_join)
...
...
theano/sandbox/cuda/tests/test_opt.py
浏览文件 @
5c826bdc
...
@@ -74,7 +74,8 @@ def test_softmax_with_bias():
...
@@ -74,7 +74,8 @@ def test_softmax_with_bias():
def
test_opt_gpujoin_onlyajoin
():
def
test_opt_gpujoin_joinvectors_elemwise_than_minusone
():
# from a bug in normal sampling
_a
=
numpy
.
asarray
([[
1
,
2
],[
3
,
4
]],
dtype
=
'float32'
)
_a
=
numpy
.
asarray
([[
1
,
2
],[
3
,
4
]],
dtype
=
'float32'
)
_b
=
numpy
.
asarray
([[
5
,
6
,
7
],[
8
,
9
,
10
]],
dtype
=
'float32'
)
_b
=
numpy
.
asarray
([[
5
,
6
,
7
],[
8
,
9
,
10
]],
dtype
=
'float32'
)
a
=
theano
.
shared
(
_a
)
a
=
theano
.
shared
(
_a
)
...
@@ -94,6 +95,7 @@ def test_opt_gpujoin_onlyajoin():
...
@@ -94,6 +95,7 @@ def test_opt_gpujoin_onlyajoin():
assert
numpy
.
all
(
f
()
==
numpy
.
concatenate
([
_a
,
_b
],
axis
=
1
))
assert
numpy
.
all
(
f
()
==
numpy
.
concatenate
([
_a
,
_b
],
axis
=
1
))
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
test_opt_gpujoin_onlyajoin
()
test_opt_gpujoin_onlyajoin
()
test_opt_gpujoin_joinvectors_elemwise_than_minusone
()
theano/sandbox/rng_mrg.py
浏览文件 @
5c826bdc
...
@@ -808,7 +808,7 @@ def test_normal0():
...
@@ -808,7 +808,7 @@ def test_normal0():
print
prefix
,
'samples/sec'
,
steps
*
sample_size
[
0
]
*
sample_size
[
1
]
/
dt
print
prefix
,
'samples/sec'
,
steps
*
sample_size
[
0
]
*
sample_size
[
1
]
/
dt
sample_size
=
(
999
,
100
)
sample_size
=
(
999
,
100
)
'''
print ''
print ''
print 'ON CPU:'
print 'ON CPU:'
...
@@ -820,9 +820,12 @@ def test_normal0():
...
@@ -820,9 +820,12 @@ def test_normal0():
basictest(f, 50, -5.0, 2.0, prefix='mrg ')
basictest(f, 50, -5.0, 2.0, prefix='mrg ')
sys.stdout.flush()
sys.stdout.flush()
'''
# now with odd number of samples
# now with odd number of samples
sample_size
=
(
999
,
99
)
sample_size
=
(
10
,
10
)
#sample_size = (999,99)
print
''
print
''
print
'ON GPU:'
print
'ON GPU:'
...
@@ -832,12 +835,16 @@ def test_normal0():
...
@@ -832,12 +835,16 @@ def test_normal0():
f
=
theano
.
function
([],
theano
.
Out
(
f
=
theano
.
function
([],
theano
.
Out
(
theano
.
sandbox
.
cuda
.
basic_ops
.
gpu_from_host
(
n
),
theano
.
sandbox
.
cuda
.
basic_ops
.
gpu_from_host
(
n
),
borrow
=
True
))
borrow
=
True
))
theano
.
printing
.
debugprint
(
f
)
theano
.
printing
.
debugprint
(
f
)
sys
.
stdout
.
flush
()
print
'random?[:10]
\n
'
,
numpy
.
asarray
(
f
())[
0
,
0
:
10
]
print
'random?[:10]
\n
'
,
numpy
.
asarray
(
f
())[
0
,
0
:
10
]
print
'----'
sys
.
stdout
.
flush
()
basictest
(
f
,
50
,
-
5.0
,
2.0
,
prefix
=
'gpu mrg '
)
basictest
(
f
,
50
,
-
5.0
,
2.0
,
prefix
=
'gpu mrg '
)
sys
.
stdout
.
flush
()
'''
print ''
print ''
print 'ON CPU w NUMPY:'
print 'ON CPU w NUMPY:'
RR = theano.tensor.shared_randomstreams.RandomStreams(234)
RR = theano.tensor.shared_randomstreams.RandomStreams(234)
...
@@ -846,10 +853,11 @@ def test_normal0():
...
@@ -846,10 +853,11 @@ def test_normal0():
ff = theano.function([], nn)
ff = theano.function([], nn)
basictest(ff, 50, -5.0, 2.0, prefix='numpy ')
basictest(ff, 50, -5.0, 2.0, prefix='numpy ')
'''
#
if __name__ == '__main__':
if
__name__
==
'__main__'
:
#
# with: export THEANO_FLAGS=device=gpu0,floatX=float32
# with: export THEANO_FLAGS=device=gpu0,floatX=float32
#
test_normal0()
test_normal0
()
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论