Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
facb53ae
提交
facb53ae
authored
5月 07, 2015
作者:
Melanie Ducoffe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adds dtype in props of AllocEmpty and remove debug print
上级
4ec148bd
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
3 行增加
和
6 行删除
+3
-6
basic.py
theano/tensor/basic.py
+2
-3
blas.py
theano/tensor/blas.py
+0
-3
test_blas.py
theano/tensor/tests/test_blas.py
+1
-0
没有找到文件。
theano/tensor/basic.py
浏览文件 @
facb53ae
...
@@ -5473,7 +5473,7 @@ class Choose(Op):
...
@@ -5473,7 +5473,7 @@ class Choose(Op):
class
AllocEmpty
(
gof
.
Op
):
class
AllocEmpty
(
gof
.
Op
):
"""Implement Alloc on the gpu, but without initializing memory."""
"""Implement Alloc on the gpu, but without initializing memory."""
__props__
=
()
__props__
=
(
"dtype"
,
)
# specify the type of the data
# specify the type of the data
def
__init__
(
self
,
dtype
):
def
__init__
(
self
,
dtype
):
...
@@ -5550,8 +5550,7 @@ class AllocEmpty(gof.Op):
...
@@ -5550,8 +5550,7 @@ class AllocEmpty(gof.Op):
return
[
node
.
inputs
]
return
[
node
.
inputs
]
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
return
None
return
(
2
,)
#return (1,)
def
do_constant_folding
(
self
,
node
):
def
do_constant_folding
(
self
,
node
):
return
False
return
False
theano/tensor/blas.py
浏览文件 @
facb53ae
...
@@ -1830,21 +1830,18 @@ def local_dot22_to_ger_or_gemv(node):
...
@@ -1830,21 +1830,18 @@ def local_dot22_to_ger_or_gemv(node):
# x and y are both vectors so this qualifies for a sdot / ddot
# x and y are both vectors so this qualifies for a sdot / ddot
# TODO: Theano doesn't have a sdot, but gemv is better than _dot22
# TODO: Theano doesn't have a sdot, but gemv is better than _dot22
xv
=
x
.
dimshuffle
(
1
)
xv
=
x
.
dimshuffle
(
1
)
#zeros = T.zeros([1], x.dtype)
zeros
=
T
.
AllocEmpty
(
x
.
dtype
)(
1
)
zeros
=
T
.
AllocEmpty
(
x
.
dtype
)(
1
)
rval
=
gemv_no_inplace
(
zeros
,
one
,
y
.
T
,
xv
,
zero
)
rval
=
gemv_no_inplace
(
zeros
,
one
,
y
.
T
,
xv
,
zero
)
return
[
rval
.
dimshuffle
(
'x'
,
0
)]
return
[
rval
.
dimshuffle
(
'x'
,
0
)]
if
xb
[
0
]
and
not
yb
[
0
]
and
not
yb
[
1
]:
if
xb
[
0
]
and
not
yb
[
0
]
and
not
yb
[
1
]:
# x is vector, y is matrix so try gemv
# x is vector, y is matrix so try gemv
xv
=
x
.
dimshuffle
(
1
)
xv
=
x
.
dimshuffle
(
1
)
#zeros = T.zeros([y.shape[1]], x.dtype)
zeros
=
T
.
AllocEmpty
(
x
.
dtype
)(
y
.
shape
[
1
])
zeros
=
T
.
AllocEmpty
(
x
.
dtype
)(
y
.
shape
[
1
])
rval
=
gemv_no_inplace
(
zeros
,
one
,
y
.
T
,
xv
,
zero
)
rval
=
gemv_no_inplace
(
zeros
,
one
,
y
.
T
,
xv
,
zero
)
return
[
rval
.
dimshuffle
(
'x'
,
0
)]
return
[
rval
.
dimshuffle
(
'x'
,
0
)]
if
not
xb
[
0
]
and
not
xb
[
1
]
and
yb
[
1
]:
if
not
xb
[
0
]
and
not
xb
[
1
]
and
yb
[
1
]:
# x is matrix, y is vector, try gemv
# x is matrix, y is vector, try gemv
yv
=
y
.
dimshuffle
(
0
)
yv
=
y
.
dimshuffle
(
0
)
#zeros = T.zeros([x.shape[0]], dtype=x.dtype)
zeros
=
T
.
AllocEmpty
(
x
.
dtype
)(
x
.
shape
[
0
])
zeros
=
T
.
AllocEmpty
(
x
.
dtype
)(
x
.
shape
[
0
])
rval
=
gemv_no_inplace
(
zeros
,
one
,
x
,
yv
,
zero
)
rval
=
gemv_no_inplace
(
zeros
,
one
,
x
,
yv
,
zero
)
return
[
rval
.
dimshuffle
(
0
,
'x'
)]
return
[
rval
.
dimshuffle
(
0
,
'x'
)]
...
...
theano/tensor/tests/test_blas.py
浏览文件 @
facb53ae
...
@@ -930,6 +930,7 @@ def test_dot22scalar():
...
@@ -930,6 +930,7 @@ def test_dot22scalar():
mode
=
mode_blas_opt
)
mode
=
mode_blas_opt
)
topo
=
f
.
maker
.
fgraph
.
toposort
()
topo
=
f
.
maker
.
fgraph
.
toposort
()
check_dot22scalar
(
f
,
5
)
check_dot22scalar
(
f
,
5
)
#print (av.dtype, bv.dtype, cv.dtype)
f
(
av
,
bv
,
cv
)
f
(
av
,
bv
,
cv
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论