Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
04716f2f
提交
04716f2f
authored
4月 16, 2015
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2764 from nouiz/windows
Windows fixed and support Anaconda blas on Windows
上级
72faef33
93559855
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
67 行增加
和
8 行删除
+67
-8
install_windows.txt
doc/install_windows.txt
+7
-3
configdefaults.py
theano/configdefaults.py
+5
-2
configparser.py
theano/configparser.py
+6
-1
cmodule.py
theano/gof/cmodule.py
+10
-2
blas.py
theano/tensor/blas.py
+39
-0
没有找到文件。
doc/install_windows.txt
浏览文件 @
04716f2f
...
...
@@ -170,7 +170,7 @@ can download the installation for free.
Alternative: Anaconda
CE
Alternative: Anaconda
+++++++++++++++++++++++
ContinuumIO_ is providing a free Python distribution for Windows (32-bit
...
...
@@ -178,11 +178,15 @@ and 64-bit), including all dependencies of Theano. If you are not
eligible for a download of EPD or Canopy (via a commercial, or free academic
licence), this is the easiest way to install
Theano's dependencies. Simply download and execute the installer from
`Anaconda
CE download page <http://continuum.io/anacondace.html
>`__,
then download and execute the :ref:`windows_anaconda`.
`Anaconda
download page <https://store.continuum.io/cshop/anaconda/
>`__,
and execute the following in Windows command line:
.. _ContinuumIO: http://continuum.io
.. code-block:: bash
$ conda install mingw libpython
Alternative: Python(x,y)
++++++++++++++++++++++++
...
...
theano/configdefaults.py
浏览文件 @
04716f2f
...
...
@@ -145,14 +145,17 @@ param = "g++"
try
:
rc
=
call_subprocess_Popen
([
'g++'
,
'-v'
])
except
OSError
:
param
=
""
rc
=
1
if
rc
!=
0
:
param
=
""
# On Mac we test for 'clang++' and use it by default
if
sys
.
platform
==
'darwin'
:
try
:
rc
=
call_subprocess_Popen
([
'clang++'
,
'-v'
])
param
=
"clang++"
if
rc
==
0
:
param
=
"clang++"
except
OSError
:
pass
...
...
theano/configparser.py
浏览文件 @
04716f2f
...
...
@@ -2,6 +2,7 @@
# as False, and the string s'True', 'true', '1' as True.
# We also accept the bool type as its corresponding value!
import
inspect
import
logging
import
os
import
shlex
...
...
@@ -272,7 +273,11 @@ class ConfigParam(object):
try
:
val_str
=
fetch_val_for_key
(
self
.
fullname
)
except
KeyError
:
if
callable
(
self
.
default
):
if
inspect
.
isgeneratorfunction
(
self
.
default
):
for
v
in
self
.
default
():
val_str
=
v
self
.
__set__
(
None
,
val_str
)
elif
callable
(
self
.
default
):
val_str
=
self
.
default
()
else
:
val_str
=
self
.
default
...
...
theano/gof/cmodule.py
浏览文件 @
04716f2f
...
...
@@ -1575,9 +1575,17 @@ class Compiler(object):
if
fd
is
not
None
:
os
.
close
(
fd
)
finally
:
os
.
remove
(
path
)
os
.
remove
(
exe_path
)
if
os
.
path
.
exists
(
path
):
os
.
remove
(
path
)
if
os
.
path
.
exists
(
exe_path
):
os
.
remove
(
exe_path
)
if
os
.
path
.
exists
(
exe_path
+
".exe"
):
os
.
remove
(
exe_path
+
".exe"
)
except
OSError
,
e
:
if
err
is
None
:
err
=
str
(
e
)
else
:
err
+=
"
\n
"
+
str
(
e
)
compilation_ok
=
False
if
not
try_run
and
not
output
:
...
...
theano/tensor/blas.py
浏览文件 @
04716f2f
...
...
@@ -160,6 +160,31 @@ _logger = logging.getLogger('theano.tensor.blas')
# We need to define blas.ldflag before we try to import scipy.
# Otherwise, we give an optimization warning for no reason in some cases.
def
default_blas_ldflags
():
"""This is a generator. It work in 2 step. The first we guess a
default blas, then we test it. If it fail, we return an empty
blas.
This is needed for Anaconda on Windows. I wasn't able to find how
to detect if the mkl from Anaconda can be reused or not. I was not
able to find a way to test it with try_flags correctly. Also, this
will test the real code, so we do not need to update the test in
case the software change. This also enables the test for all
cases.
"""
flags
=
static_default_blas_flags
()
yield
flags
# Now test it!
x
=
theano
.
tensor
.
fmatrix
()
try
:
theano
.
function
([
x
],
theano
.
tensor
.
blas
.
_dot22
(
x
,
x
))
except
Exception
as
e
:
print
e
yield
""
def
static_default_blas_flags
():
try
:
if
(
hasattr
(
numpy
.
distutils
,
'__config__'
)
and
numpy
.
distutils
.
__config__
):
...
...
@@ -256,6 +281,20 @@ SOMEPATH/Canopy_64bit/User/lib/python2.7/site-packages/numpy/distutils/system_in
# same as what is in blas_info['libraries']?
[
'-l
%
s'
%
l
for
l
in
[
"mk2_core"
,
"mk2_intel_thread"
,
"mk2_rt"
]])
# Anaconda
if
"Anaconda"
in
sys
.
version
and
sys
.
platform
==
"win32"
:
lib_path
=
os
.
path
.
join
(
sys
.
prefix
,
'pkgs'
)
for
dir
in
os
.
listdir
(
lib_path
):
if
dir
.
startswith
(
"mkl-rt-"
):
lib_path
=
os
.
path
.
join
(
lib_path
,
dir
,
"DLLs"
)
break
if
os
.
path
.
exists
(
lib_path
):
#-LC:\\Users\\*\\Anaconda\\libs
flags
=
[
'-L
%
s'
%
lib_path
]
flags
+=
[
'-l
%
s'
%
l
for
l
in
[
"mkl_core"
,
"mkl_intel_thread"
,
"mkl_rt"
]]
return
' '
.
join
(
flags
)
# if numpy was linked with library that are not installed, we
# can't reuse them.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论