Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
26720198
提交
26720198
authored
1月 14, 2013
作者:
lamblin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1156 from nouiz/popen_windows
Popen windows
上级
997fc864
26fb4b1a
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
41 行增加
和
8 行删除
+41
-8
.travis.yml
.travis.yml
+6
-0
configdefaults.py
theano/configdefaults.py
+3
-1
cmodule.py
theano/gof/cmodule.py
+2
-1
compiledir.py
theano/gof/compiledir.py
+6
-3
op.py
theano/gof/op.py
+2
-1
windows.py
theano/misc/windows.py
+17
-0
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+3
-1
run_tests_in_batch.py
theano/tests/run_tests_in_batch.py
+2
-1
没有找到文件。
.travis.yml
浏览文件 @
26720198
...
...
@@ -25,3 +25,8 @@ script:
-
python --version
-
echo $PART
-
theano-nose $PART
#after_script:
#after_failure:
#after_success:
\ No newline at end of file
theano/configdefaults.py
浏览文件 @
26720198
...
...
@@ -6,6 +6,7 @@ from theano.configparser import (
AddConfigVar
,
BoolParam
,
ConfigParam
,
EnumStr
,
IntParam
,
TheanoConfigParser
)
from
theano.misc.cpucount
import
cpuCount
from
theano.misc.windows
import
call_subprocess_Popen
_logger
=
logging
.
getLogger
(
'theano.configdefaults'
)
...
...
@@ -99,7 +100,8 @@ enum = EnumStr("g++", "")
# in an unusual Python 2.4.4 Windows environment with the default stdin=None.
dummy_stdin
=
open
(
os
.
devnull
)
try
:
subprocess
.
Popen
(
'g++'
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
call_subprocess_Popen
(
'g++'
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
stdin
=
dummy_stdin
.
fileno
())
# Keep the default linker the same as the one for the mode FAST_RUN
AddConfigVar
(
'linker'
,
...
...
theano/gof/cmodule.py
浏览文件 @
26720198
...
...
@@ -22,6 +22,7 @@ import theano
from
theano.gof.utils
import
flatten
from
theano.configparser
import
config
from
theano.gof.cc
import
hash_from_code
from
theano.misc.windows
import
call_subprocess_Popen
# we will abuse the lockfile mechanism when reading and writing the registry
import
compilelock
...
...
@@ -1592,7 +1593,7 @@ class GCC_compiler(object):
print
>>
sys
.
stderr
,
' '
.
join
(
cmd
)
try
:
p
=
subprocess
.
Popen
(
cmd
,
stderr
=
subprocess
.
PIPE
)
p
=
call_subprocess_
Popen
(
cmd
,
stderr
=
subprocess
.
PIPE
)
compile_stderr
=
p
.
communicate
()[
1
]
except
Exception
:
# An exception can occur e.g. if `g++` is not found.
...
...
theano/gof/compiledir.py
浏览文件 @
26720198
...
...
@@ -3,8 +3,8 @@ import errno
import
os
import
platform
import
re
import
subprocess
import
shutil
import
subprocess
import
sys
import
textwrap
...
...
@@ -13,6 +13,7 @@ import numpy
import
theano
from
theano.configparser
import
config
,
AddConfigVar
,
ConfigParam
,
StrParam
from
theano.gof.utils
import
flatten
from
theano.misc.windows
import
call_subprocess_Popen
# Using the dummy file descriptors below is a workaround for a crash
# experienced in an unusual Python 2.4.4 Windows environment with the default
...
...
@@ -21,8 +22,10 @@ dummy_in = open(os.devnull)
dummy_err
=
open
(
os
.
devnull
,
'w'
)
p
=
None
try
:
p
=
subprocess
.
Popen
([
'g++'
,
'-dumpversion'
],
stdout
=
subprocess
.
PIPE
,
stdin
=
dummy_in
.
fileno
(),
stderr
=
dummy_err
.
fileno
())
p
=
call_subprocess_Popen
([
'g++'
,
'-dumpversion'
],
stdout
=
subprocess
.
PIPE
,
stdin
=
dummy_in
.
fileno
(),
stderr
=
dummy_err
.
fileno
())
p
.
wait
()
gcc_version_str
=
p
.
stdout
.
readline
()
.
strip
()
except
OSError
:
...
...
theano/gof/op.py
浏览文件 @
26720198
...
...
@@ -20,6 +20,7 @@ import warnings
import
theano
from
theano
import
config
from
theano.misc.windows
import
call_subprocess_Popen
import
cc
import
graph
...
...
@@ -788,7 +789,7 @@ class OpenMPOp(Op):
os
.
write
(
fd
,
code
)
os
.
close
(
fd
)
fd
=
None
proc
=
subprocess
.
Popen
([
'g++'
,
'-fopenmp'
,
path
],
proc
=
call_subprocess_
Popen
([
'g++'
,
'-fopenmp'
,
path
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
stdin
=
dummy_stdin
.
fileno
())
...
...
theano/misc/windows.py
0 → 100644
浏览文件 @
26720198
import
os
import
subprocess
def
call_subprocess_Popen
(
command
,
**
params
):
"""
Utility function to work around windows behavior that open windows
"""
startupinfo
=
None
if
os
.
name
==
'nt'
:
startupinfo
=
subprocess
.
STARTUPINFO
()
try
:
startupinfo
.
dwFlags
|=
subprocess
.
STARTF_USESHOWWINDOW
except
AttributeError
:
startupinfo
.
dwFlags
|=
subprocess
.
_subprocess
.
STARTF_USESHOWWINDOW
proc
=
subprocess
.
Popen
(
command
,
startupinfo
=
startupinfo
,
**
params
)
return
proc
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
26720198
...
...
@@ -15,6 +15,7 @@ from theano.gof.cmodule import (std_libs, std_lib_dirs,
std_include_dirs
,
dlimport
,
get_lib_extension
,
local_bitwidth
)
from
theano.gof.python25
import
any
from
theano.misc.windows
import
call_subprocess_Popen
_logger
=
logging
.
getLogger
(
"theano.sandbox.cuda.nvcc_compiler"
)
_logger
.
setLevel
(
logging
.
WARN
)
...
...
@@ -64,7 +65,8 @@ nvcc_version = None
def
is_nvcc_available
():
"""Return True iff the nvcc compiler is found."""
def
set_version
():
p
=
subprocess
.
Popen
([
nvcc_path
,
'--version'
],
stdout
=
subprocess
.
PIPE
,
p
=
call_subprocess_Popen
([
nvcc_path
,
'--version'
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
p
.
wait
()
s
=
p
.
stdout
.
readlines
()[
-
1
]
.
split
(
','
)[
1
]
.
strip
()
.
split
()
...
...
theano/tests/run_tests_in_batch.py
浏览文件 @
26720198
...
...
@@ -60,6 +60,7 @@ import subprocess
import
sys
import
datetime
import
theano
from
theano.misc.windows
import
call_subprocess_Popen
def
main
(
stdout
=
None
,
stderr
=
None
,
argv
=
None
,
theano_nose
=
None
,
...
...
@@ -264,7 +265,7 @@ def run(stdout, stderr, argv, theano_nose, batch_size, time_profile,
data
[
"ids"
][
test_id
]))
f_rawlog
.
flush
()
proc
=
subprocess
.
Popen
(
proc
=
call_subprocess_
Popen
(
([
python
,
theano_nose
,
'-v'
,
'--with-id'
]
+
[
str
(
test_id
)]
+
argv
+
[
'--disabdocstring'
]),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论