Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
dbe96b2a
提交
dbe96b2a
authored
1月 11, 2012
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
put the number of iterations as a parameter.
上级
065133f3
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
11 行增加
和
13 行删除
+11
-13
check_blas.py
theano/misc/check_blas.py
+11
-13
没有找到文件。
theano/misc/check_blas.py
浏览文件 @
dbe96b2a
...
...
@@ -21,17 +21,12 @@ import theano.tensor as T
from
theano.gof.python25
import
any
default_M
,
default_N
,
default_K
=
(
2000
,
2000
,
2000
)
iters
=
10
def
execute
(
execute
=
True
,
verbose
=
True
,
M
=
None
,
N
=
None
,
K
=
None
,
iters
=
10
):
if
M
is
None
:
M
=
default_M
if
N
is
None
:
N
=
default_N
if
K
is
None
:
K
=
default_K
def
execute
(
execute
=
True
,
verbose
=
True
,
M
=
2000
,
N
=
2000
,
K
=
2000
,
iters
=
10
):
"""
:param execute: If True, execute a Theano function that should call gemm
:param verbose: If True, will print some Theano flags and env variable.
"""
a
=
theano
.
shared
(
numpy
.
ones
((
M
,
N
),
dtype
=
theano
.
config
.
floatX
))
b
=
theano
.
shared
(
numpy
.
ones
((
N
,
K
),
dtype
=
theano
.
config
.
floatX
))
...
...
@@ -109,6 +104,9 @@ parser.add_option('-N', '--N', action='store', dest='N',
parser
.
add_option
(
'-K'
,
'--K'
,
action
=
'store'
,
dest
=
'K'
,
default
=
2000
,
type
=
"int"
,
help
=
"The K size to gemm"
)
parser
.
add_option
(
'--iter'
,
action
=
'store'
,
dest
=
'iter'
,
default
=
10
,
type
=
"int"
,
help
=
"The number of call to gemm"
)
if
__name__
==
"__main__"
:
options
,
arguments
=
parser
.
parse_args
(
sys
.
argv
)
...
...
@@ -118,12 +116,12 @@ if __name__ == "__main__":
sys
.
exit
(
0
)
t
=
execute
(
not
options
.
print_only
,
not
options
.
quiet
,
M
=
options
.
M
,
N
=
options
.
N
,
K
=
options
.
K
)
N
=
options
.
N
,
K
=
options
.
K
,
iters
=
options
.
iter
)
if
not
options
.
quiet
:
print
"""
Some results that you can compare against. They were 10 executions
of gemm in float64 with matrices of shape 2000x2000.
of gemm in float64 with matrices of shape 2000x2000
(M=N=K=2000)
.
CPU tested: Xeon E5345(2.33Ghz, 8M L2 cache, 1333Mhz FSB),
Xeon E5430(2.66Ghz, 12M L2 cache, 1333Mhz FSB),
...
...
@@ -184,7 +182,7 @@ if __name__ == "__main__":
"""
print
print
"We timed"
,
iters
,
print
"We timed"
,
options
.
iter
,
print
"executions of gemm with a and b matrix of shapes"
,
print
"(
%
d,
%
d) and (
%
d,
%
d)."
%
(
options
.
M
,
options
.
N
,
options
.
N
,
options
.
K
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论