Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ccf3cef1
提交
ccf3cef1
authored
1月 26, 2012
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix Ger C code when output is a row or column.
Some BLAS versions did not accept (1,1) strides in that case.
上级
c8f8dba5
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
16 行增加
和
4 行删除
+16
-4
blas_c.py
theano/tensor/blas_c.py
+10
-4
test_blas.py
theano/tensor/tests/test_blas.py
+6
-0
没有找到文件。
theano/tensor/blas_c.py
浏览文件 @
ccf3cef1
...
@@ -128,14 +128,20 @@ def ger_c_code(A, a, x, y, Z, destructive, fail):
...
@@ -128,14 +128,20 @@ def ger_c_code(A, a, x, y, Z, destructive, fail):
}
}
{
{
int Nz0 =
%(Z)
s->dimensions[0];
int Nz0 =
%(Z)
s->dimensions[0];
int Nz1 =
%(Z)
s->dimensions[1];
int Nz1 =
%(Z)
s->dimensions[1];
int Sz0 =
%(Z)
s->strides[0] / elemsize;
int Sz1 =
%(Z)
s->strides[1] / elemsize;
int Sx =
%(x)
s->strides[0] / elemsize;
int Sx =
%(x)
s->strides[0] / elemsize;
int Sy =
%(y)
s->strides[0] / elemsize;
int Sy =
%(y)
s->strides[0] / elemsize;
/* create appropriate strides for Z, if it is a row or column matrix.
* In that case, the value of the stride does not really matter, but
* some versions of BLAS insist that:
* - they are not smaller than the number of elements in the array,
* - they are not 0.
*/
int Sz0 = (Nz0 > 1) ? (
%(Z)
s->strides[0] / elemsize) : (Nz1 + 1);
int Sz1 = (Nz1 > 1) ? (
%(Z)
s->strides[1] / elemsize) : (Nz0 + 1);
if (1)
if (1)
{
{
if (
%(Z)
s->strides[0] == elemsize)
if (
%(Z)
s->strides[0] == elemsize)
...
@@ -198,7 +204,7 @@ class CGer(BaseBLAS, Ger):
...
@@ -198,7 +204,7 @@ class CGer(BaseBLAS, Ger):
return
code
return
code
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
return
(
3
,)
return
(
4
,)
@local_optimizer
([
ger
,
ger_destructive
])
@local_optimizer
([
ger
,
ger_destructive
])
...
...
theano/tensor/tests/test_blas.py
浏览文件 @
ccf3cef1
...
@@ -1378,6 +1378,12 @@ class TestGer(TestCase, unittest_tools.TestOptimizationMixin):
...
@@ -1378,6 +1378,12 @@ class TestGer(TestCase, unittest_tools.TestOptimizationMixin):
def
test_f32_4_4
(
self
):
def
test_f32_4_4
(
self
):
return
self
.
given_dtype
(
'float32'
,
4
,
4
)
return
self
.
given_dtype
(
'float32'
,
4
,
4
)
def
test_f32_7_1
(
self
):
return
self
.
given_dtype
(
'float32'
,
7
,
1
)
def
test_f32_1_2
(
self
):
return
self
.
given_dtype
(
'float32'
,
1
,
2
)
def
test_f64_4_5
(
self
):
def
test_f64_4_5
(
self
):
return
self
.
given_dtype
(
'float64'
,
4
,
5
)
return
self
.
given_dtype
(
'float64'
,
4
,
5
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论