Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
8bb90e12
提交
8bb90e12
authored
9月 16, 2011
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added CudaNdarray.is_c_contiguous().
上级
71eccb91
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
12 行增加
和
0 行删除
+12
-0
cuda_ndarray.cu
theano/sandbox/cuda/cuda_ndarray.cu
+3
-0
cuda_ndarray.cuh
theano/sandbox/cuda/cuda_ndarray.cuh
+4
-0
test_cuda_ndarray.py
theano/sandbox/cuda/tests/test_cuda_ndarray.py
+5
-0
没有找到文件。
theano/sandbox/cuda/cuda_ndarray.cu
浏览文件 @
8bb90e12
...
@@ -810,6 +810,9 @@ static PyMethodDef CudaNdarray_methods[] =
...
@@ -810,6 +810,9 @@ static PyMethodDef CudaNdarray_methods[] =
{
"copy"
,
{
"copy"
,
(
PyCFunction
)
CudaNdarray_Copy
,
METH_NOARGS
,
(
PyCFunction
)
CudaNdarray_Copy
,
METH_NOARGS
,
"Create a copy of this object"
},
"Create a copy of this object"
},
{
"is_c_contiguous"
,
(
PyCFunction
)
CudaNdarray_IS_C_Contiguous
,
METH_NOARGS
,
"Return True is the object is c contiguous. False otherwise."
},
{
"reduce_sum"
,
{
"reduce_sum"
,
(
PyCFunction
)
CudaNdarray_ReduceSum
,
METH_O
,
(
PyCFunction
)
CudaNdarray_ReduceSum
,
METH_O
,
"Reduce over the given dimensions by summation"
},
"Reduce over the given dimensions by summation"
},
...
...
theano/sandbox/cuda/cuda_ndarray.cuh
浏览文件 @
8bb90e12
...
@@ -504,6 +504,10 @@ CudaNdarray_ZEROS(int n, int * dims);
...
@@ -504,6 +504,10 @@ CudaNdarray_ZEROS(int n, int * dims);
* True iff the strides look like [dim[nd-2], dim[nd-3], ... , dim[0], 1]
* True iff the strides look like [dim[nd-2], dim[nd-3], ... , dim[0], 1]
*/
*/
bool
CudaNdarray_is_c_contiguous
(
const
CudaNdarray
*
self
);
bool
CudaNdarray_is_c_contiguous
(
const
CudaNdarray
*
self
);
PyObject
*
CudaNdarray_IS_C_Contiguous
(
CudaNdarray
*
self
)
{
return
PyBool_FromLong
(
CudaNdarray_is_c_contiguous
(
self
));
}
int
CudaNdarray_gemm
(
float
alpha
,
const
CudaNdarray
*
A
,
const
CudaNdarray
*
B
,
float
beta
,
CudaNdarray
*
C
);
int
CudaNdarray_gemm
(
float
alpha
,
const
CudaNdarray
*
A
,
const
CudaNdarray
*
B
,
float
beta
,
CudaNdarray
*
C
);
int
CudaNdarray_sger
(
float
alpha
,
CudaNdarray
*
x
,
CudaNdarray
*
y
,
CudaNdarray
*
A
);
int
CudaNdarray_sger
(
float
alpha
,
CudaNdarray
*
x
,
CudaNdarray
*
y
,
CudaNdarray
*
A
);
...
...
theano/sandbox/cuda/tests/test_cuda_ndarray.py
浏览文件 @
8bb90e12
...
@@ -909,6 +909,11 @@ def test_base():
...
@@ -909,6 +909,11 @@ def test_base():
e
=
b
.
reshape
((
5
,
2
,
2
,
3
))
e
=
b
.
reshape
((
5
,
2
,
2
,
3
))
assert
e
.
base
is
a
assert
e
.
base
is
a
def
test_is_c_contiguous
():
a
=
cuda_ndarray
.
CudaNdarray
.
zeros
((
3
,
4
,
5
))
assert
a
.
is_c_contiguous
()
assert
a
[
1
]
.
is_c_contiguous
()
assert
not
a
[::
2
]
.
is_c_contiguous
()
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
test_zeros_basic_3d_tensor
()
test_zeros_basic_3d_tensor
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论