Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f79fcf6a
提交
f79fcf6a
authored
8月 21, 2017
作者:
notoraptor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow to modifiy system PATH environment variable at runtime on Windows.
上级
078bdfb1
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
61 行增加
和
0 行删除
+61
-0
dnn.py
theano/gpuarray/dnn.py
+4
-0
pathparse.py
theano/pathparse.py
+57
-0
没有找到文件。
theano/gpuarray/dnn.py
浏览文件 @
f79fcf6a
...
@@ -49,6 +49,7 @@ from .opt import (gpu_seqopt, register_opt, pool_db, pool_db2,
...
@@ -49,6 +49,7 @@ from .opt import (gpu_seqopt, register_opt, pool_db, pool_db2,
from
.opt_util
import
alpha_merge
,
output_merge
,
inplace_allocempty
,
pad_dims
,
unpad_dims
from
.opt_util
import
alpha_merge
,
output_merge
,
inplace_allocempty
,
pad_dims
,
unpad_dims
from
theano.configdefaults
import
SUPPORTED_DNN_CONV_ALGO_RUNTIME
from
theano.configdefaults
import
SUPPORTED_DNN_CONV_ALGO_RUNTIME
import
theano.pathparse
DNN_CONV_ALGO_CHOOSE_ONCE
=
[
'guess_once'
,
'time_once'
]
DNN_CONV_ALGO_CHOOSE_ONCE
=
[
'guess_once'
,
'time_once'
]
DNN_CONV_ALGO_CHOOSE_TIME
=
[
'time_once'
,
'time_on_shape_change'
]
DNN_CONV_ALGO_CHOOSE_TIME
=
[
'time_once'
,
'time_on_shape_change'
]
...
@@ -61,6 +62,9 @@ except ImportError:
...
@@ -61,6 +62,9 @@ except ImportError:
# Update these names when new versions of cudnn are supported.
# Update these names when new versions of cudnn are supported.
WIN32_CUDNN_NAMES
=
[
'cudnn64_7.dll'
,
'cudnn64_6.dll'
,
'cudnn64_5.dll'
]
WIN32_CUDNN_NAMES
=
[
'cudnn64_7.dll'
,
'cudnn64_6.dll'
,
'cudnn64_5.dll'
]
if
sys
.
platform
==
'win32'
:
theano
.
pathparse
.
PathParser
(
theano
.
config
.
dnn
.
bin_path
)
def
_load_lib
(
name
):
def
_load_lib
(
name
):
try
:
try
:
...
...
theano/pathparse.py
0 → 100644
浏览文件 @
f79fcf6a
from
__future__
import
absolute_import
,
print_function
,
division
import
os
import
sys
class
PathParser
(
object
):
"""
Class that allows to modify system's PATH environment variable
at runtime. Currently used in ``theano.gpuarray.dnn`` module
on Windows only.
**Examples**:
..code-block:: python
theano.pathparse.PathParser(pathToAdd1, pathToAdd2, ...)
# PATH is then automatically updated for this execution.
..code-block:: python
paths = theano.pathparse.PathParser()
paths.add(path1)
paths.add(path2)
# PATH is updated after each call to ``add()``.
"""
paths
=
set
()
def
_add
(
self
,
path
):
path
=
path
.
strip
()
if
path
:
if
sys
.
platform
==
'win32'
:
# Windows is case-insensitive.
path
=
path
.
lower
()
self
.
paths
.
add
(
os
.
path
.
abspath
(
path
))
def
_update
(
self
):
os
.
environ
[
'PATH'
]
=
os
.
pathsep
.
join
(
sorted
(
self
.
paths
))
def
_parse
(
self
):
for
path
in
os
.
environ
[
'PATH'
]
.
split
(
os
.
pathsep
):
self
.
_add
(
path
)
def
__init__
(
self
,
*
paths
):
self
.
_parse
()
for
path
in
paths
:
self
.
_add
(
path
)
self
.
_update
()
def
add
(
self
,
path
):
self
.
_add
(
path
)
self
.
_update
()
def
_debug
(
self
):
for
path
in
sorted
(
self
.
paths
):
print
(
path
)
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论