Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c4ab09e9
提交
c4ab09e9
authored
3月 09, 2010
作者:
Razvan Pascanu
浏览文件
操作
浏览文件
下载
差异文件
merge
上级
324184a7
81deaae0
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
33 行增加
和
13 行删除
+33
-13
configdefaults.py
theano/configdefaults.py
+3
-1
cmodule.py
theano/gof/cmodule.py
+8
-2
printing.py
theano/printing.py
+2
-6
__init__.py
theano/sandbox/cuda/__init__.py
+10
-4
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+9
-0
test_conv_cuda_ndarray.py
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
+1
-0
没有找到文件。
theano/configdefaults.py
浏览文件 @
c4ab09e9
...
...
@@ -8,9 +8,11 @@ AddConfigVar('floatX',
EnumStr
(
'float64'
,
'float32'
),
)
#gpu mean let the driver select the gpu. Needed in case of gpu in exclusive mode.
#gpuX mean use the gpu number X.
AddConfigVar
(
'device'
,
"Default device for computations"
,
EnumStr
(
'cpu'
,
*
[
'gpu
%
i'
%
i
for
i
in
range
(
4
)])
EnumStr
(
'cpu'
,
'gpu'
,
*
[
'gpu
%
i'
%
i
for
i
in
range
(
4
)])
)
# keep the default mode.optimizer==config.optimizer and mode.linker==config.linker!
...
...
theano/gof/cmodule.py
浏览文件 @
c4ab09e9
...
...
@@ -629,7 +629,6 @@ def gcc_module_compile_str(module_name, src_code, location=None, include_dirs=[]
python_inc
=
distutils
.
sysconfig
.
get_python_inc
()
libname
=
os
.
path
.
basename
(
python_inc
)
#DSE Patch 1 for supporting OSX frameworks; add -framework Python
if
sys
.
platform
==
'darwin'
:
preargs
.
extend
([
'-undefined'
,
'dynamic_lookup'
])
...
...
@@ -639,8 +638,15 @@ def gcc_module_compile_str(module_name, src_code, location=None, include_dirs=[]
if
python_inc
.
count
(
'Python.framework'
)
>
0
and
config
.
cmodule
.
mac_framework_link
:
preargs
.
extend
([
'-framework'
,
'Python'
])
workdir
=
location
# sometimes, the linker cannot find -lpython so we need to tell it
# explicitly where it is located
# this returns somepath/lib/python2.5/site-packages
python_lib
=
distutils
.
sysconfig
.
get_python_lib
()
python_lib
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
python_lib
))
if
python_lib
not
in
lib_dirs
:
lib_dirs
.
append
(
python_lib
)
workdir
=
location
cppfilename
=
os
.
path
.
join
(
location
,
'mod.cpp'
)
cppfile
=
file
(
cppfilename
,
'w'
)
...
...
theano/printing.py
浏览文件 @
c4ab09e9
...
...
@@ -441,12 +441,8 @@ def pydotprint(fct, outfile=os.path.join(config.compiledir,'theano.pydotprint.pn
g
.
add_node
(
pd
.
Node
(
varstr
,
color
=
'grey'
))
elif
var
.
name
or
not
compact
:
g
.
add_edge
(
pd
.
Edge
(
astr
,
varstr
))
else
:
#no name, so we don't make a var ellipse
for
client
in
var
.
clients
:
edge
=
pd
.
Edge
(
astr
,
apply_name
(
client
[
0
]))
g
.
add_edge
(
edge
)
g
.
set_simplify
(
True
)
# else:
#don't add egde here as it is already added from the inputs.
g
.
write_png
(
outfile
,
prog
=
'dot'
)
print
'The output file is available at'
,
outfile
...
...
theano/sandbox/cuda/__init__.py
浏览文件 @
c4ab09e9
...
...
@@ -112,7 +112,9 @@ if cuda_available:
def
use
(
device
):
global
cuda_enabled
,
enabled_cuda
if
device
.
startswith
(
'gpu'
):
if
device
==
'gpu'
:
pass
elif
device
.
startswith
(
'gpu'
):
device
=
int
(
device
[
3
:])
elif
device
==
'cpu'
:
device
=
-
1
...
...
@@ -120,13 +122,17 @@ def use(device):
raise
ValueError
(
"Invalid device identifier"
,
device
)
if
use
.
device_number
is
None
:
# No successful call to use() has been made yet
if
device
<
0
:
if
device
!=
'gpu'
and
device
<
0
:
return
if
device
in
[
None
,
""
]:
device
=
0
device
=
int
(
device
)
try
:
gpu_init
(
device
)
if
device
!=
'gpu'
:
gpu_init
(
device
)
else
:
#warning To let people see that the gpu will be used.
_logger
.
warn
(
"We let the driver select the gpu device to use"
)
handle_shared_float32
(
True
)
use
.
device_number
=
device
cuda_enabled
=
True
...
...
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
c4ab09e9
...
...
@@ -2,6 +2,7 @@ import sys, os, subprocess, logging
from
theano.gof.cmodule
import
(
std_libs
,
std_lib_dirs
,
std_include_dirs
,
dlimport
,
get_lib_extension
)
from
theano
import
config
import
distutils
_logger
=
logging
.
getLogger
(
"theano.sandbox.cuda.nvcc_compiler"
)
_logger
.
setLevel
(
logging
.
WARN
)
...
...
@@ -68,6 +69,14 @@ def nvcc_module_compile_str(module_name, src_code, location=None, include_dirs=[
if
cuda_root
:
lib_dirs
.
append
(
os
.
path
.
join
(
cuda_root
,
'lib'
))
# sometimes, the linker cannot find -lpython so we need to tell it
# explicitly where it is located
# this returns somepath/lib/python2.5/site-packages
python_lib
=
distutils
.
sysconfig
.
get_python_lib
()
python_lib
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
python_lib
))
if
python_lib
not
in
lib_dirs
:
lib_dirs
.
append
(
python_lib
)
cppfilename
=
os
.
path
.
join
(
location
,
'mod.cu'
)
cppfile
=
file
(
cppfilename
,
'w'
)
...
...
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
浏览文件 @
c4ab09e9
...
...
@@ -225,6 +225,7 @@ def get_shapes2(scales_img=(1,1), scales_kern=(1,1), subsample=(1,1), img_stride
return
shapes
def
test_valid
():
raise
Exception
(
'One of the modes here causes a segmentation fault!'
)
# img shape, kern shape, subsample shape
shapes
=
get_basic_shapes
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论