Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
01078889
提交
01078889
authored
5月 27, 2015
作者:
--global
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert previous change to replace dot22 with gemm instead of dot22scalar
上级
c7a81516
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6 行增加
和
14 行删除
+6
-14
blas.py
theano/tensor/blas.py
+6
-14
没有找到文件。
theano/tensor/blas.py
浏览文件 @
01078889
...
@@ -2043,12 +2043,8 @@ def local_dot22_to_dot22scalar(node):
...
@@ -2043,12 +2043,8 @@ def local_dot22_to_dot22scalar(node):
a
=
T
.
cast
(
_as_scalar
(
m
.
owner
.
inputs
[
scalar_idx
],
a
=
T
.
cast
(
_as_scalar
(
m
.
owner
.
inputs
[
scalar_idx
],
dtype
=
d
.
dtype
),
d
.
type
.
dtype
)
dtype
=
d
.
dtype
),
d
.
type
.
dtype
)
assert
not
a
.
type
.
ndim
assert
not
a
.
type
.
ndim
dot
=
_dot22scalar
(
d
.
owner
.
inputs
[
0
],
d
.
owner
.
inputs
[
1
],
a
)
z
=
T
.
AllocEmpty
(
d
.
owner
.
inputs
[
0
]
.
dtype
)(
d
.
owner
.
inputs
[
0
]
.
shape
[
0
],
d
.
owner
.
inputs
[
1
]
.
shape
[
1
])
zero
=
T
.
as_tensor_variable
(
numpy
.
asarray
(
0
,
dtype
=
a
.
dtype
))
dot
=
gemm
(
z
,
a
,
d
.
owner
.
inputs
[
0
],
d
.
owner
.
inputs
[
1
],
zero
)
# The other inputs to the original node that were
# The other inputs to the original node that were
# neither part of the dot22 or this mul should be
# neither part of the dot22 or this mul should be
# factors in the returned "mul" node.
# factors in the returned "mul" node.
...
@@ -2083,16 +2079,12 @@ def local_dot22_to_dot22scalar(node):
...
@@ -2083,16 +2079,12 @@ def local_dot22_to_dot22scalar(node):
a
=
T
.
cast
(
i_scalar
[
scalar_idx
],
d
.
type
.
dtype
)
a
=
T
.
cast
(
i_scalar
[
scalar_idx
],
d
.
type
.
dtype
)
assert
not
a
.
type
.
ndim
assert
not
a
.
type
.
ndim
if
len
(
o
)
==
0
:
if
len
(
o
)
==
0
:
z
=
T
.
AllocEmpty
(
d
.
owner
.
inputs
[
0
]
.
dtype
)(
d
.
owner
.
inputs
[
0
]
.
shape
[
0
],
return
[
_dot22scalar
(
d
.
owner
.
inputs
[
0
],
d
.
owner
.
inputs
[
1
],
a
)]
d
.
owner
.
inputs
[
1
]
.
shape
[
1
])
zero
=
T
.
as_tensor_variable
(
numpy
.
asarray
(
0
,
dtype
=
a
.
dtype
))
return
[
gemm
(
z
,
a
,
d
.
owner
.
inputs
[
0
],
d
.
owner
.
inputs
[
1
],
zero
)]
else
:
else
:
z
=
T
.
AllocEmpty
(
d
.
owner
.
inputs
[
0
]
.
dtype
)(
d
.
owner
.
inputs
[
0
]
.
shape
[
0
],
return
[
T
.
mul
(
_dot22scalar
(
d
.
owner
.
inputs
[
0
],
d
.
owner
.
inputs
[
1
]
.
shape
[
1
])
d
.
owner
.
inputs
[
1
],
a
),
*
o
)]
zero
=
T
.
as_tensor_variable
(
numpy
.
asarray
(
0
,
dtype
=
a
.
dtype
))
return
[
T
.
mul
(
gemm
(
z
,
a
,
d
.
owner
.
inputs
[
0
],
d
.
owner
.
inputs
[
1
],
zero
),
*
o
)]
# must happen after gemm as the gemm optimizer don't understant
# must happen after gemm as the gemm optimizer don't understant
# dot22scalar and gemm give more speed up then dot22scalar
# dot22scalar and gemm give more speed up then dot22scalar
blas_optdb
.
register
(
'local_dot22_to_dot22scalar'
,
blas_optdb
.
register
(
'local_dot22_to_dot22scalar'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论