Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
8a1af5b8
提交
8a1af5b8
authored
7月 19, 2017
作者:
abergeron
提交者:
GitHub
7月 19, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6169 from lamblin/fix_gemv_dot
Fix strides when using dot inside gemv
上级
c58166ca
f4a78f95
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
12 行增加
和
5 行删除
+12
-5
blas.py
theano/gpuarray/blas.py
+1
-5
test_blas.py
theano/gpuarray/tests/test_blas.py
+11
-0
没有找到文件。
theano/gpuarray/blas.py
浏览文件 @
8a1af5b8
...
@@ -120,16 +120,12 @@ class GpuGemv(BlasOp):
...
@@ -120,16 +120,12 @@ class GpuGemv(BlasOp):
%(out)
s->ga.nd = 0;
%(out)
s->ga.nd = 0;
%(A)
s->ga.nd = 1;
%(A)
s->ga.nd = 1;
%(A)
s->ga.dimensions[0] =
%(A)
s->ga.dimensions[1];
%(A)
s->ga.dimensions[0] =
%(A)
s->ga.dimensions[1];
if (
%(A)
s->ga.flags & GA_C_CONTIGUOUS) {
ssize_t a_stride0 =
%(A)
s->ga.strides[0];
ssize_t a_stride0 =
%(A)
s->ga.strides[0];
%(A)
s->ga.strides[0] =
%(A)
s->ga.strides[1];
%(A)
s->ga.strides[0] =
%(A)
s->ga.strides[1];
if (pygpu_blas_rdot(
%(x)
s,
%(A)
s,
%(out)
s, 0) == -1) {
if (pygpu_blas_rdot(
%(x)
s,
%(A)
s,
%(out)
s, 0) == -1) {
%(fail)
s
%(fail)
s
}
}
%(A)
s->ga.strides[0] = a_stride0;
%(A)
s->ga.strides[0] = a_stride0;
} else if (pygpu_blas_rdot(
%(x)
s,
%(A)
s,
%(out)
s, 0) == -1) {
%(fail)
s
}
%(out)
s->ga.nd = 1;
%(out)
s->ga.nd = 1;
%(A)
s->ga.nd = 2;
%(A)
s->ga.nd = 2;
%(A)
s->ga.dimensions[0] = 1;
%(A)
s->ga.dimensions[0] = 1;
...
@@ -149,7 +145,7 @@ class GpuGemv(BlasOp):
...
@@ -149,7 +145,7 @@ class GpuGemv(BlasOp):
return
code
return
code
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
return
(
7
,)
return
(
8
,)
gpugemv_no_inplace
=
GpuGemv
(
inplace
=
False
)
gpugemv_no_inplace
=
GpuGemv
(
inplace
=
False
)
gpugemv_inplace
=
GpuGemv
(
inplace
=
True
)
gpugemv_inplace
=
GpuGemv
(
inplace
=
True
)
...
...
theano/gpuarray/tests/test_blas.py
浏览文件 @
8a1af5b8
...
@@ -234,3 +234,14 @@ def test_gemv_zeros():
...
@@ -234,3 +234,14 @@ def test_gemv_zeros():
tmp
=
f
(
A
,
b
)
tmp
=
f
(
A
,
b
)
assert
np
.
allclose
(
tmp
,
assert
np
.
allclose
(
tmp
,
np
.
zeros
((
dim
,)))
np
.
zeros
((
dim
,)))
def
test_gemv_dot_strides
():
# Reported in https://github.com/Theano/Theano/issues/6142
xv
=
rand
(
5
)
yv
=
rand
(
5
,
1
)
x
=
gpuarray_shared_constructor
(
xv
)
y
=
gpuarray_shared_constructor
(
yv
,
broadcastable
=
(
False
,
True
))
f
=
theano
.
function
([],
tensor
.
dot
(
x
,
y
[::
-
1
]),
mode
=
mode_with_gpu
)
out
=
f
()
utt
.
assert_allclose
(
out
,
np
.
dot
(
xv
,
yv
[::
-
1
]))
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论