Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4b831a4a
提交
4b831a4a
authored
2月 12, 2013
作者:
Vivek Kulkarni
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Addressing code review comments.
上级
dee8d3e6
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
22 行增加
和
13 行删除
+22
-13
basic_ops.py
theano/sandbox/cuda/basic_ops.py
+12
-3
cuda_ndarray.cu
theano/sandbox/cuda/cuda_ndarray.cu
+0
-9
cuda_ndarray.cuh
theano/sandbox/cuda/cuda_ndarray.cuh
+10
-1
没有找到文件。
theano/sandbox/cuda/basic_ops.py
浏览文件 @
4b831a4a
...
@@ -2457,7 +2457,7 @@ class GpuAdvancedIncSubtensor1(tensor.AdvancedIncSubtensor1, GpuOp):
...
@@ -2457,7 +2457,7 @@ class GpuAdvancedIncSubtensor1(tensor.AdvancedIncSubtensor1, GpuOp):
return
"""
return
"""
PyObject *x_obj, *y_obj, *row_x, *row_y;
PyObject *x_obj, *y_obj, *row_x, *row_y;
PyObject *x_rowind_obj, *y_rowind_obj;
PyObject *x_rowind_obj, *y_rowind_obj;
int
*p_index;
dtype_
%(ind)
s
*p_index;
int num_indices, j;
int num_indices, j;
Py_XDECREF(
%(out)
s);
Py_XDECREF(
%(out)
s);
...
@@ -2474,14 +2474,23 @@ class GpuAdvancedIncSubtensor1(tensor.AdvancedIncSubtensor1, GpuOp):
...
@@ -2474,14 +2474,23 @@ class GpuAdvancedIncSubtensor1(tensor.AdvancedIncSubtensor1, GpuOp):
for (j = 0;j < num_indices; j++) {
for (j = 0;j < num_indices; j++) {
p_index = (
int
*)PyArray_GETPTR1(
%(ind)
s, j);
p_index = (
dtype_
%(ind)
s
*)PyArray_GETPTR1(
%(ind)
s, j);
x_rowind_obj = PyInt_FromLong(*p_index);
x_rowind_obj = PyInt_FromLong(*p_index);
assert(PyInt_AsLong(x_rowind_obj) == (*p_index));
y_rowind_obj = PyInt_FromLong(j);
y_rowind_obj = PyInt_FromLong(j);
assert(PyInt_AsLong(y_rowind_obj) == j);
row_x = CudaNdarray_Subscript(x_obj, x_rowind_obj);
row_x = CudaNdarray_Subscript(x_obj, x_rowind_obj);
row_y = CudaNdarray_Subscript(y_obj, y_rowind_obj);
row_y = CudaNdarray_Subscript(y_obj, y_rowind_obj);
CudaNdarray_inplace_add(row_x, row_y);
CudaNdarray_inplace_elemwise(row_x, row_y, IADD);
Py_XDECREF(x_rowind_obj);
Py_XDECREF(y_rowind_obj);
}
}
Py_XDECREF(x_obj);
Py_XDECREF(y_obj);
if (!
%(out)
s) {
if (!
%(out)
s) {
%(fail)
s
%(fail)
s
}
}
...
...
theano/sandbox/cuda/cuda_ndarray.cu
浏览文件 @
4b831a4a
...
@@ -746,15 +746,6 @@ PyObject * CudaNdarray_View(const CudaNdarray * self)
...
@@ -746,15 +746,6 @@ PyObject * CudaNdarray_View(const CudaNdarray * self)
return
(
PyObject
*
)
rval
;
return
(
PyObject
*
)
rval
;
}
}
enum
operator_t
{
IADD
=
0
,
IDIV
,
CPY
,
N_ELEMWISE_OPS
// This is to know the number of operation
};
/*
/*
* d0,... are the output dims
* d0,... are the output dims
* indices are a list of index to operate on
* indices are a list of index to operate on
...
...
theano/sandbox/cuda/cuda_ndarray.cuh
浏览文件 @
4b831a4a
...
@@ -95,6 +95,15 @@ struct CudaNdarray
...
@@ -95,6 +95,15 @@ struct CudaNdarray
real
*
devdata
;
//pointer to data element [0,..,0].
real
*
devdata
;
//pointer to data element [0,..,0].
};
};
enum
operator_t
{
IADD
=
0
,
IDIV
,
CPY
,
N_ELEMWISE_OPS
// This is to know the number of operation
};
/*
/*
* Return a CudaNdarray whose 'nd' dimensions are all 0.
* Return a CudaNdarray whose 'nd' dimensions are all 0.
* if nd==-1, it is not initialized.
* if nd==-1, it is not initialized.
...
@@ -478,8 +487,8 @@ int fprint_CudaNdarray(FILE * fd, const CudaNdarray *self);
...
@@ -478,8 +487,8 @@ int fprint_CudaNdarray(FILE * fd, const CudaNdarray *self);
PyObject
*
CudaNdarray_View
(
const
CudaNdarray
*
self
);
PyObject
*
CudaNdarray_View
(
const
CudaNdarray
*
self
);
PyObject
*
CudaNdarray_inplace_add
(
PyObject
*
py_self
,
PyObject
*
py_other
);
PyObject
*
CudaNdarray_Subscript
(
PyObject
*
py_self
,
PyObject
*
key
);
PyObject
*
CudaNdarray_Subscript
(
PyObject
*
py_self
,
PyObject
*
key
);
int
CudaNdarray_inplace_elemwise
(
PyObject
*
py_self
,
PyObject
*
py_other
,
operator_t
fct_nb
);
// Ensures that *arr is a pointer to a contiguous ndarray of the specified
// Ensures that *arr is a pointer to a contiguous ndarray of the specified
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论