Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
27a681ce
提交
27a681ce
authored
3月 04, 2017
作者:
Frédéric Bastien
提交者:
GitHub
3月 04, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5652 from lamblin/fix_small_tests
A couple of test fixes
上级
3cfdc345
93c724f4
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
29 行增加
和
29 行删除
+29
-29
jenkins_test2.sh
.jenkins/jenkins_test2.sh
+2
-1
profiling.py
theano/compile/profiling.py
+4
-3
test_profiling.py
theano/compile/tests/test_profiling.py
+2
-2
op.py
theano/gof/op.py
+13
-2
vm.py
theano/gof/vm.py
+0
-16
test_dnn.py
theano/gpuarray/tests/test_dnn.py
+2
-0
printing.py
theano/printing.py
+1
-1
test_scan_checkpoints.py
theano/scan_module/tests/test_scan_checkpoints.py
+4
-3
test_printing.py
theano/tests/test_printing.py
+1
-1
没有找到文件。
.jenkins/jenkins_test2.sh
浏览文件 @
27a681ce
...
...
@@ -75,6 +75,7 @@ THEANO_GPUARRAY_TESTS="theano/gpuarray/tests \
theano/sandbox/tests/test_rng_mrg.py:test_consistency_GPUA_serial
\
theano/sandbox/tests/test_rng_mrg.py:test_consistency_GPUA_parallel
\
theano/sandbox/tests/test_rng_mrg.py:test_GPUA_full_fill
\
theano/scan_module/tests/test_scan.py:T_Scan_Gpuarray"
theano/scan_module/tests/test_scan.py:T_Scan_Gpuarray
\
theano/scan_module/tests/test_scan_checkpoints.py:TestScanCheckpoint.test_memory"
FLAGS
=
"init_gpu_device=
$DEVICE
,gpuarray.preallocate=1000,mode=FAST_RUN,on_opt_error=raise,on_shape_error=raise,cmodule.age_thresh_use=604800"
THEANO_FLAGS
=
${
FLAGS
}
time
nosetests
--with-xunit
--xunit-file
=
theanogpuarray_tests.xml
${
THEANO_GPUARRAY_TESTS
}
theano/compile/profiling.py
浏览文件 @
27a681ce
...
...
@@ -251,8 +251,9 @@ class ProfileStats(object):
# param is called flag_time_thunks because most other attributes with time
# in the name are times *of* something, rather than configuration flags.
def
__init__
(
self
,
atexit_print
=
True
,
flag_time_thunks
=
None
,
**
kwargs
):
if
(
config
.
profile
and
def
__init__
(
self
,
atexit_print
=
True
,
flag_time_thunks
=
None
,
gpu_checks
=
True
,
**
kwargs
):
if
(
config
.
profile
and
gpu_checks
and
((
hasattr
(
theano
,
'sandbox'
)
and
hasattr
(
theano
.
sandbox
,
'cuda'
)
and
theano
.
sandbox
.
cuda
.
cuda_enabled
)
or
(
...
...
@@ -266,7 +267,7 @@ class ProfileStats(object):
" You must set the environment variable"
" CUDA_LAUNCH_BLOCKING to 1 to tell the CUDA driver to"
" synchronize the execution to get a meaningful profile."
)
if
(
config
.
profile
and
if
(
config
.
profile
and
gpu_checks
and
hasattr
(
theano
,
'gpuarray'
)
and
theano
.
gpuarray
.
pygpu_activated
and
not
config
.
profiling
.
ignore_first_call
):
...
...
theano/compile/tests/test_profiling.py
浏览文件 @
27a681ce
...
...
@@ -35,7 +35,7 @@ class Test_profiling(unittest.TestCase):
z
+=
[
T
.
outer
(
x
[
i
],
x
[
i
+
1
])
.
sum
(
axis
=
1
)
for
i
in
range
(
len
(
x
)
-
1
)]
z
+=
[
x
[
i
]
+
x
[
i
+
1
]
for
i
in
range
(
len
(
x
)
-
1
)]
p
=
theano
.
ProfileStats
(
False
)
p
=
theano
.
ProfileStats
(
False
,
gpu_checks
=
False
)
if
theano
.
config
.
mode
in
[
"DebugMode"
,
"DEBUG_MODE"
,
"FAST_COMPILE"
]:
m
=
"FAST_RUN"
...
...
@@ -87,7 +87,7 @@ class Test_profiling(unittest.TestCase):
z
=
ifelse
(
T
.
lt
(
a
,
b
),
x
*
2
,
y
*
2
)
p
=
theano
.
ProfileStats
(
False
)
p
=
theano
.
ProfileStats
(
False
,
gpu_checks
=
False
)
if
theano
.
config
.
mode
in
[
"DebugMode"
,
"DEBUG_MODE"
,
"FAST_COMPILE"
]:
m
=
"FAST_RUN"
...
...
theano/gof/op.py
浏览文件 @
27a681ce
...
...
@@ -19,7 +19,7 @@ import theano
from
theano
import
config
import
theano.gof.cc
from
six
import
itervalues
from
six
import
itervalues
,
PY3
from
theano.gof
import
graph
from
theano.gof
import
utils
from
theano.gof.cmodule
import
GCC_compiler
...
...
@@ -35,6 +35,17 @@ __docformat__ = "restructuredtext en"
_logger
=
logging
.
getLogger
(
'theano.gof.op.Op'
)
# Open file in "universal newline mode".
# In Python 2, this is done by calling open(..., 'U'), but this is
# deprected in Python 3 (where we would need to pass "newline=None",
# which is the default).
if
PY3
:
_open_u
=
open
else
:
def
_open_u
(
file
):
return
open
(
file
,
'U'
)
class
CLinkerObject
(
object
):
"""
Standard elements of an Op or Type used with the CLinker.
...
...
@@ -1297,7 +1308,7 @@ class COp(Op):
self
.
func_codes
=
[]
for
func_file
in
func_files
:
# U (universal) will convert all new lines format to \n.
with
open
(
func_file
,
'U'
)
as
f
:
with
_open_u
(
func_file
)
as
f
:
self
.
func_codes
.
append
(
f
.
read
())
# If both the old section markers and the new section markers are
...
...
theano/gof/vm.py
浏览文件 @
27a681ce
...
...
@@ -10,7 +10,6 @@ from __future__ import absolute_import, print_function, division
from
.
import
link
from
collections
import
defaultdict
import
logging
import
os
import
sys
import
time
import
warnings
...
...
@@ -757,21 +756,6 @@ class VM_Linker(link.LocalLinker):
associated to self, else, a new VM_Linker associated to fgraph.
"""
if
((
config
.
profile
or
config
.
print_global_stats
)
and
((
hasattr
(
theano
,
'sandbox'
)
and
hasattr
(
theano
.
sandbox
,
'cuda'
)
and
theano
.
sandbox
.
cuda
.
cuda_enabled
)
or
(
hasattr
(
theano
,
'gpuarray'
)
and
theano
.
gpuarray
.
pygpu_activated
))):
if
os
.
environ
.
get
(
'CUDA_LAUNCH_BLOCKING'
,
'0'
)
!=
'1'
:
raise
Exception
(
"You are running the Theano profiler with CUDA enabled."
" Theano GPU ops execution is asynchronous by default."
" So by default, the profile is useless."
" You must set the environment variable"
" CUDA_LAUNCH_BLOCKING to 1 to tell the CUDA driver to"
" synchronize the execution to get a meaningful profile."
)
if
no_recycling
is
None
:
no_recycling
=
[]
if
self
.
fgraph
is
not
None
and
self
.
fgraph
is
not
fgraph
:
...
...
theano/gpuarray/tests/test_dnn.py
浏览文件 @
27a681ce
...
...
@@ -511,6 +511,8 @@ def test_pooling_opt_arbitrary_dimensions():
def
test_pooling_empty_batch
():
if
not
dnn
.
dnn_available
(
test_ctx_name
):
raise
SkipTest
(
dnn
.
dnn_available
.
msg
)
img_shp
=
(
0
,
5
,
6
,
8
)
img
=
T
.
ftensor4
(
'img'
)
...
...
theano/printing.py
浏览文件 @
27a681ce
...
...
@@ -863,7 +863,7 @@ def pydotprint(fct, outfile=None,
if
profile
:
time
=
profile
.
apply_time
.
get
(
node
,
0
)
# second, %fct time in profiler
if
profile
.
fct_callcount
==
0
:
if
profile
.
fct_callcount
==
0
or
profile
.
fct_call_time
==
0
:
pf
=
0
else
:
pf
=
time
*
100
/
profile
.
fct_call_time
...
...
theano/scan_module/tests/test_scan_checkpoints.py
浏览文件 @
27a681ce
...
...
@@ -53,12 +53,13 @@ class TestScanCheckpoint(unittest.TestCase):
"""Test that scan_checkpoint reduces memory usage."""
if
None
not
in
theano
.
gpuarray
.
type
.
list_contexts
():
return
unittest
.
SkipTest
(
'Requires gpuarray backend.'
)
from
theano.gpuarray.tests.config
import
mode_with_gpu
# noqa
f
=
theano
.
function
(
inputs
=
[
self
.
A
,
self
.
k
],
outputs
=
self
.
grad_A
)
outputs
=
self
.
grad_A
,
mode
=
mode_with_gpu
)
f_check
=
theano
.
function
(
inputs
=
[
self
.
A
,
self
.
k
],
outputs
=
self
.
grad_A_check
)
outputs
=
self
.
grad_A_check
,
mode
=
mode_with_gpu
)
free_gmem
=
theano
.
gpuarray
.
type
.
_context_reg
[
None
]
.
free_gmem
data
=
numpy
.
ones
(
free_gmem
/
3000
,
dtype
=
numpy
.
float32
)
data
=
numpy
.
ones
(
free_gmem
/
/
3000
,
dtype
=
numpy
.
float32
)
# Check that it works with the checkpoints
f_check
(
data
,
1000
)
# Check that the basic scan fails in that case
...
...
theano/tests/test_printing.py
浏览文件 @
27a681ce
...
...
@@ -91,7 +91,7 @@ def test_pydotprint_profile():
raise
SkipTest
(
'pydot not available'
)
A
=
tensor
.
matrix
()
prof
=
theano
.
compile
.
ProfileStats
(
atexit_print
=
False
)
prof
=
theano
.
compile
.
ProfileStats
(
atexit_print
=
False
,
gpu_checks
=
False
)
f
=
theano
.
function
([
A
],
A
+
1
,
profile
=
prof
)
theano
.
printing
.
pydotprint
(
f
,
print_output_file
=
False
)
f
([[
1
]])
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论