Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
0f4ced9d
提交
0f4ced9d
authored
12月 07, 2009
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added the theano flags op.set_flops that will make convop in profile mode print…
added the theano flags op.set_flops that will make convop in profile mode print the number of flops.
上级
487bfc2b
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
7 行增加
和
2 行删除
+7
-2
config.py
theano/config.py
+4
-1
conv.py
theano/sandbox/conv.py
+3
-1
没有找到文件。
theano/config.py
浏览文件 @
0f4ced9d
...
@@ -8,6 +8,7 @@ default_={
...
@@ -8,6 +8,7 @@ default_={
'ProfileMode.n_ops_to_print'
:
20
,
'ProfileMode.n_ops_to_print'
:
20
,
'tensor_opt.local_elemwise_fusion'
:
False
,
'tensor_opt.local_elemwise_fusion'
:
False
,
'lib.amdlibm'
:
False
,
'lib.amdlibm'
:
False
,
'op.set_flops'
:
False
,
#currently used only in ConvOp. The profile mode will print the flops/s for the op.
}
}
#default value taked from env variable
#default value taked from env variable
...
@@ -38,6 +39,8 @@ THEANO_DEBUGMODE_CHECK_PY = bool(int(os.getenv('THEANO_DEBUGMODE_CHECK_PY', 1)))
...
@@ -38,6 +39,8 @@ THEANO_DEBUGMODE_CHECK_PY = bool(int(os.getenv('THEANO_DEBUGMODE_CHECK_PY', 1)))
THEANO_DEBUGMODE_CHECK_FINITE
=
bool
(
int
(
os
.
getenv
(
'THEANO_DEBUGMODE_CHECK_FINITE'
,
1
)))
THEANO_DEBUGMODE_CHECK_FINITE
=
bool
(
int
(
os
.
getenv
(
'THEANO_DEBUGMODE_CHECK_FINITE'
,
1
)))
THEANO_DEBUGMODE_CHECK_STRIDES
=
bool
(
int
(
os
.
getenv
(
'THEANO_DEBUGMODE_CHECK_STRIDES'
,
1
)))
THEANO_DEBUGMODE_CHECK_STRIDES
=
bool
(
int
(
os
.
getenv
(
'THEANO_DEBUGMODE_CHECK_STRIDES'
,
1
)))
THEANO_FLAGS
=
os
.
getenv
(
"THEANO_FLAGS"
,
""
)
class
TheanoConfig
(
object
):
class
TheanoConfig
(
object
):
"""Return the value for a key after parsing ~/.theano.cfg and
"""Return the value for a key after parsing ~/.theano.cfg and
the THEANO_FLAGS environment variable.
the THEANO_FLAGS environment variable.
...
@@ -72,7 +75,7 @@ class TheanoConfig(object):
...
@@ -72,7 +75,7 @@ class TheanoConfig(object):
#user config file override the default value
#user config file override the default value
self
.
config
.
read
([
'theano.cfg'
,
os
.
path
.
expanduser
(
'~/.theano.cfg'
)])
self
.
config
.
read
([
'theano.cfg'
,
os
.
path
.
expanduser
(
'~/.theano.cfg'
)])
self
.
env_flags
=
os
.
getenv
(
"THEANO_FLAGS"
,
""
)
self
.
env_flags
=
THEANO_FLAGS
#The value in the env variable THEANO_FLAGS override the previous value
#The value in the env variable THEANO_FLAGS override the previous value
for
flag
in
self
.
env_flags
.
split
(
','
):
for
flag
in
self
.
env_flags
.
split
(
','
):
if
not
flag
:
if
not
flag
:
...
...
theano/sandbox/conv.py
浏览文件 @
0f4ced9d
import
numpy
as
N
import
numpy
as
N
import
theano
import
theano
import
theano.tensor
as
T
import
theano.tensor
as
T
from
theano
import
gof
,
Op
,
tensor
from
theano
import
gof
,
Op
,
tensor
,
config
from
theano.printing
import
Print
from
theano.printing
import
Print
def
getFilterOutShp
(
inshp
,
kshp
,
(
dx
,
dy
)
=
(
1
,
1
),
mode
=
'valid'
):
def
getFilterOutShp
(
inshp
,
kshp
,
(
dx
,
dy
)
=
(
1
,
1
),
mode
=
'valid'
):
...
@@ -131,6 +131,8 @@ class ConvOp(Op):
...
@@ -131,6 +131,8 @@ class ConvOp(Op):
"'valid' mode)"
)
%
(
self
.
imshp_logical
,
self
.
kshp_logical
))
"'valid' mode)"
)
%
(
self
.
imshp_logical
,
self
.
kshp_logical
))
self
.
_rehash
()
self
.
_rehash
()
if
config
.
config
.
getboolean
(
'op.set_flops'
):
self
.
set_flops
()
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
if
type
(
self
)
!=
type
(
other
):
if
type
(
self
)
!=
type
(
other
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论