Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
7790833a
提交
7790833a
authored
12月 12, 2012
作者:
lamblin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1132 from nouiz/misc2
Misc2
上级
b02ea197
c64e3a87
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
22 行增加
和
10 行删除
+22
-10
check_blas.py
theano/misc/check_blas.py
+2
-0
basic_ops.py
theano/sandbox/cuda/basic_ops.py
+6
-2
test_determinism.py
theano/tests/test_determinism.py
+14
-8
没有找到文件。
theano/misc/check_blas.py
浏览文件 @
7790833a
...
@@ -205,6 +205,8 @@ if __name__ == "__main__":
...
@@ -205,6 +205,8 @@ if __name__ == "__main__":
C2075/4.2 0.25s
C2075/4.2 0.25s
GTX285/4.2 0.452s #cuda 3.0 seam faster? driver version?
GTX285/4.2 0.452s #cuda 3.0 seam faster? driver version?
GTX460/4.0 0.45s
GTX580/3.2 0.203s
GTX580/3.2 0.203s
GTX680/3.2 0.218s
GTX680/3.2 0.218s
GTX480/3.2 0.237s
GTX480/3.2 0.237s
...
...
theano/sandbox/cuda/basic_ops.py
浏览文件 @
7790833a
...
@@ -59,7 +59,9 @@ class HostFromGpu(GpuOp):
...
@@ -59,7 +59,9 @@ class HostFromGpu(GpuOp):
def
make_node
(
self
,
x
):
def
make_node
(
self
,
x
):
if
not
isinstance
(
x
.
type
,
CudaNdarrayType
):
if
not
isinstance
(
x
.
type
,
CudaNdarrayType
):
raise
TypeError
(
x
)
raise
TypeError
(
"Expected a Theano variable with type "
"CudaNdarrayType. Got
%
s with type
%
s"
%
(
x
,
x
.
type
))
return
Apply
(
self
,
[
x
],
[
tensor
.
TensorType
(
dtype
=
x
.
dtype
,
return
Apply
(
self
,
[
x
],
[
tensor
.
TensorType
(
dtype
=
x
.
dtype
,
broadcastable
=
x
.
broadcastable
)()])
broadcastable
=
x
.
broadcastable
)()])
...
@@ -113,7 +115,9 @@ class GpuFromHost(GpuOp):
...
@@ -113,7 +115,9 @@ class GpuFromHost(GpuOp):
def
make_node
(
self
,
x
):
def
make_node
(
self
,
x
):
if
not
isinstance
(
x
.
type
,
tensor
.
TensorType
):
if
not
isinstance
(
x
.
type
,
tensor
.
TensorType
):
raise
TypeError
(
x
)
raise
TypeError
(
"Expected a Theano variable with type "
"TensorType. Got
%
s with type
%
s"
%
(
x
,
x
.
type
))
return
Apply
(
self
,
[
x
],
[
CudaNdarrayType
(
broadcastable
=
x
.
broadcastable
,
return
Apply
(
self
,
[
x
],
[
CudaNdarrayType
(
broadcastable
=
x
.
broadcastable
,
dtype
=
x
.
dtype
)()])
dtype
=
x
.
dtype
)()])
...
...
theano/tests/test_determinism.py
浏览文件 @
7790833a
...
@@ -6,16 +6,17 @@ import numpy as np
...
@@ -6,16 +6,17 @@ import numpy as np
import
theano
import
theano
from
theano.printing
import
var_descriptor
from
theano.printing
import
var_descriptor
from
cStringIO
import
StringIO
from
cStringIO
import
StringIO
from
nose.plugins.skip
import
SkipTest
from
theano
import
config
from
theano
import
config
from
theano
import
shared
from
theano
import
shared
def
sharedX
(
x
,
name
=
None
):
def
sharedX
(
x
,
name
=
None
):
x
=
np
.
cast
[
config
.
floatX
](
x
)
x
=
np
.
cast
[
config
.
floatX
](
x
)
return
shared
(
x
,
name
)
return
shared
(
x
,
name
)
def
test_determinism_1
():
def
test_determinism_1
():
# Tests that repeatedly running a script that compiles and
# Tests that repeatedly running a script that compiles and
...
@@ -24,7 +25,12 @@ def test_determinism_1():
...
@@ -24,7 +25,12 @@ def test_determinism_1():
# change.
# change.
# This specific script is capable of catching a bug where
# This specific script is capable of catching a bug where
# FunctionGraph.toposort was non-deterministic.
# FunctionGraph.toposort was non-deterministic.
def
run
(
replay
,
log
=
None
):
try
:
import
hashlib
except
ImportError
:
raise
SkipTest
(
'python version too old to do this test'
)
def
run
(
replay
,
log
=
None
):
if
not
replay
:
if
not
replay
:
log
=
StringIO
()
log
=
StringIO
()
...
@@ -32,7 +38,6 @@ def test_determinism_1():
...
@@ -32,7 +38,6 @@ def test_determinism_1():
log
=
StringIO
(
log
)
log
=
StringIO
(
log
)
record
=
Record
(
replay
=
replay
,
file_object
=
log
)
record
=
Record
(
replay
=
replay
,
file_object
=
log
)
disturb_mem
.
disturb_mem
()
disturb_mem
.
disturb_mem
()
mode
=
RecordMode
(
record
=
record
)
mode
=
RecordMode
(
record
=
record
)
...
@@ -53,19 +58,20 @@ def test_determinism_1():
...
@@ -53,19 +58,20 @@ def test_determinism_1():
v_range
.
max
(),
v_range
.
max
(),
]):
]):
disturb_mem
.
disturb_mem
()
disturb_mem
.
disturb_mem
()
s
=
sharedX
(
0.
,
name
=
's_'
+
str
(
i
))
s
=
sharedX
(
0.
,
name
=
's_'
+
str
(
i
))
updates
.
append
((
s
,
val
))
updates
.
append
((
s
,
val
))
for
var
in
theano
.
gof
.
graph
.
ancestors
(
update
for
var
,
update
in
updates
):
for
var
in
theano
.
gof
.
graph
.
ancestors
(
update
for
_
,
update
in
updates
):
if
var
.
name
is
not
None
and
var
.
name
is
not
'b'
:
if
var
.
name
is
not
None
and
var
.
name
is
not
'b'
:
if
var
.
name
[
0
]
!=
's'
or
len
(
var
.
name
)
!=
2
:
if
var
.
name
[
0
]
!=
's'
or
len
(
var
.
name
)
!=
2
:
var
.
name
=
None
var
.
name
=
None
for
key
in
channels
:
for
key
in
channels
:
updates
.
append
((
s
,
channels
[
key
]))
updates
.
append
((
s
,
channels
[
key
]))
f
=
theano
.
function
([],
mode
=
mode
,
updates
=
updates
,
on_unused_input
=
'ignore'
,
name
=
'f'
)
f
=
theano
.
function
([],
mode
=
mode
,
updates
=
updates
,
on_unused_input
=
'ignore'
,
name
=
'f'
)
for
output
in
f
.
maker
.
fgraph
.
outputs
:
for
output
in
f
.
maker
.
fgraph
.
outputs
:
mode
.
record
.
handle_line
(
var_descriptor
(
output
)
+
'
\n
'
)
mode
.
record
.
handle_line
(
var_descriptor
(
output
)
+
'
\n
'
)
disturb_mem
.
disturb_mem
()
disturb_mem
.
disturb_mem
()
f
()
f
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论