Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
8ebe5708
提交
8ebe5708
authored
1月 10, 2013
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
When calling subprocess.Popen on windows, don't open command line windows.
上级
6ef19365
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
23 行增加
和
13 行删除
+23
-13
configdefaults.py
theano/configdefaults.py
+4
-2
cmodule.py
theano/gof/cmodule.py
+2
-1
compiledir.py
theano/gof/compiledir.py
+6
-3
op.py
theano/gof/op.py
+5
-4
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+4
-2
run_tests_in_batch.py
theano/tests/run_tests_in_batch.py
+2
-1
没有找到文件。
theano/configdefaults.py
浏览文件 @
8ebe5708
...
...
@@ -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,8 +100,9 @@ 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
,
stdin
=
dummy_stdin
.
fileno
())
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'
,
(
"Default linker used if the theano flags mode is Mode "
...
...
theano/gof/cmodule.py
浏览文件 @
8ebe5708
...
...
@@ -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
浏览文件 @
8ebe5708
...
...
@@ -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
浏览文件 @
8ebe5708
...
...
@@ -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,10 +789,10 @@ class OpenMPOp(Op):
os
.
write
(
fd
,
code
)
os
.
close
(
fd
)
fd
=
None
proc
=
subprocess
.
Popen
([
'g++'
,
'-fopenmp'
,
path
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
stdin
=
dummy_stdin
.
fileno
())
proc
=
call_subprocess_
Popen
([
'g++'
,
'-fopenmp'
,
path
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
stdin
=
dummy_stdin
.
fileno
())
proc
.
wait
()
if
proc
.
returncode
!=
0
:
default_openmp
=
False
...
...
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
8ebe5708
...
...
@@ -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,8 +65,9 @@ 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
,
stderr
=
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
()
assert
s
[
0
]
==
'release'
...
...
theano/tests/run_tests_in_batch.py
浏览文件 @
8ebe5708
...
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论