Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
589f0869
提交
589f0869
authored
3月 30, 2012
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix op for non-contiguous input and output
上级
0299784f
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
17 行增加
和
5 行删除
+17
-5
basic.py
theano/sparse/basic.py
+17
-5
没有找到文件。
theano/sparse/basic.py
浏览文件 @
589f0869
...
...
@@ -2411,8 +2411,6 @@ class UsmmCscDense(gof.Op):
npy_intp K =
%(y)
s->dimensions[0];
// pointers to access actual data in the arrays passed as params.
dtype_
%(z)
s* __restrict__ Dz = (dtype_
%(z)
s*)
%(z)
s->data;
dtype_
%(zn)
s* __restrict__ Dzn = (dtype_
%(zn)
s*)
%(zn)
s->data;
const dtype_
%(x_val)
s* __restrict__ Dval = (dtype_
%(x_val)
s*)
%(x_val)
s->data;
const npy_int32 * __restrict__ Dind = (npy_int32*)
%(x_ind)
s->data;
const npy_int32 * __restrict__ Dptr = (npy_int32*)
%(x_ptr)
s->data;
...
...
@@ -2428,7 +2426,11 @@ class UsmmCscDense(gof.Op):
if (!(
%(inplace)
s))
{
memcpy(Dzn, Dz, M*N*sizeof(dtype_
%(zn)
s));
if (PyArray_CopyInto(
%(zn)
s,
%(z)
s))
{
Py_XDECREF(
%(zn)
s);
%(fail)
s;
}
}
for (npy_int32 k = 0; k < K; ++k)
...
...
@@ -2439,9 +2441,16 @@ class UsmmCscDense(gof.Op):
const dtype_
%(x_val)
s Amk = alpha * Dval[m_idx * Sval]; // actual value at that location
const dtype_
%(y)
s* y_row = (dtype_
%(y)
s*)(
%(y)
s->data +
%(y)
s->strides[0] * k);
dtype_
%(y)
s* y_row = (dtype_
%(y)
s*)(
%(y)
s->data +
%(y)
s->strides[0] * k);
// axpy expects pointer to the beginning of memory arrays,
// so when the stride is negative, we need to get the
// last element
if (Sy < 0)
y_row += (K - 1) * Sy;
const dtype_
%(zn)
s* z_row = (dtype_
%(zn)
s*)(
%(zn)
s->data +
%(zn)
s->strides[0] * m);
dtype_
%(zn)
s* z_row = (dtype_
%(zn)
s*)(
%(zn)
s->data +
%(zn)
s->strides[0] * m);
if (Szn < 0)
z_row += (N - 1) * Szn;
%(axpy)
s((int*)&N, (
%(conv_type)
s*)&Amk, (
%(conv_type)
s*)y_row, (int*)&Sy, (
%(conv_type)
s*)z_row, (int*)&Szn);
}
...
...
@@ -2451,6 +2460,9 @@ class UsmmCscDense(gof.Op):
return
rval
def
c_code_cache_version
(
self
):
return
(
1
,)
usmm_csc_dense
=
UsmmCscDense
(
inplace
=
False
)
usmm_csc_dense_inplace
=
UsmmCscDense
(
inplace
=
True
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论