Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
62a7e19a
提交
62a7e19a
authored
2月 16, 2016
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add infer_shape to the blas ops.
上级
480ca3ad
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
15 行增加
和
11 行删除
+15
-11
blas.py
theano/tensor/blas.py
+15
-11
没有找到文件。
theano/tensor/blas.py
浏览文件 @
62a7e19a
...
...
@@ -473,6 +473,9 @@ class Gemv(Op):
out
+=
y
out_storage
[
0
][
0
]
=
numpy
.
asarray
(
out
,
dtype
=
y
.
dtype
)
def
infer_shape
(
self
,
node
,
input_shapes
):
return
[
input_shapes
[
0
]]
gemv_no_inplace
=
Gemv
(
inplace
=
False
)
gemv_inplace
=
Gemv
(
inplace
=
True
)
# For the user interface. Opt will make them inplace later
...
...
@@ -540,6 +543,9 @@ class Ger(Op):
A
+=
numpy
.
outer
(
cx
,
cy
)
cZ
[
0
]
=
A
def
infer_shape
(
self
,
node
,
input_shapes
):
return
[
input_shapes
[
0
]]
ger
=
Ger
(
destructive
=
False
)
ger_destructive
=
Ger
(
destructive
=
True
)
...
...
@@ -1001,6 +1007,8 @@ class Gemm(GemmRelated):
E_mixed
=
'gemm requires matching dtypes'
E_float
=
'gemm requires floating-point dtypes'
__props__
=
(
'inplace'
,)
def
__init__
(
self
,
inplace
):
self
.
inplace
=
inplace
if
self
.
inplace
:
...
...
@@ -1009,13 +1017,6 @@ class Gemm(GemmRelated):
else
:
self
.
setup_z_Nz_Sz
=
self
.
setup_z_Nz_Sz_outplace
def
__eq__
(
self
,
other
):
return
(
type
(
self
)
==
type
(
other
)
and
self
.
inplace
==
other
.
inplace
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
^
hash
(
self
.
inplace
)
def
__str__
(
self
):
if
self
.
inplace
:
inplace_str
=
'inplace'
...
...
@@ -1124,6 +1125,9 @@ class Gemm(GemmRelated):
z
+=
a
*
numpy
.
dot
(
x
,
y
)
zout
[
0
]
=
z
def
infer_shape
(
self
,
node
,
input_shapes
):
return
[
inputs_shapes
[
0
]]
setup_z_Nz_Sz_inplace
=
"""
if (
%(_zout)
s !=
%(_z)
s)
{
...
...
@@ -1747,8 +1751,8 @@ class Dot22(GemmRelated):
e
.
args
=
e
.
args
+
(
x
.
shape
,
y
.
shape
)
raise
def
__str__
(
self
):
return
self
.
__class__
.
__name__
def
infer_shape
(
self
,
node
,
input_shapes
):
return
[[
inputs_shapes
[
0
][
0
],
inputs_shapes
[
1
][
1
]]]
setup_z_Nz_Sz
=
"""
if ((NULL ==
%(_zout)
s)
...
...
@@ -2018,8 +2022,8 @@ class Dot22Scalar(GemmRelated):
e
.
args
=
e
.
args
+
(
x
.
shape
,
y
.
shape
)
raise
def
__str__
(
self
):
return
self
.
__class__
.
__name__
def
infer_shape
(
self
,
node
,
input_shapes
):
return
[[
input_shapes
[
0
][
0
],
input_shapes
[
1
][
1
]]]
setup_z_Nz_Sz
=
Dot22
.
setup_z_Nz_Sz
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论