Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a1bbaede
提交
a1bbaede
authored
9月 13, 2013
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update to the new signature for new_GpuArray().
上级
7459819e
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
9 行增加
和
20 行删除
+9
-20
basic_ops.py
theano/sandbox/gpuarray/basic_ops.py
+5
-5
elemwise.py
theano/sandbox/gpuarray/elemwise.py
+2
-2
subtensor.py
theano/sandbox/gpuarray/subtensor.py
+2
-13
没有找到文件。
theano/sandbox/gpuarray/basic_ops.py
浏览文件 @
a1bbaede
...
@@ -66,7 +66,7 @@ class HostFromGpu(Op):
...
@@ -66,7 +66,7 @@ class HostFromGpu(Op):
} else {
} else {
%(name)
s_ga = &
%(inp)
s->ga;
%(name)
s_ga = &
%(inp)
s->ga;
}
}
%(name)
s_dtype = typecode_to_dtype(
%(
inp)
s->ga.
typecode);
%(name)
s_dtype = typecode_to_dtype(
%(
name)
s_ga->
typecode);
Py_XDECREF(
%(out)
s);
Py_XDECREF(
%(out)
s);
// PyArray_Empty below steals a reference to the dtype we pass it
// PyArray_Empty below steals a reference to the dtype we pass it
// so we need an extra one to spare.
// so we need an extra one to spare.
...
@@ -158,7 +158,7 @@ class GpuFromHost(Op):
...
@@ -158,7 +158,7 @@ class GpuFromHost(Op):
%(fail)
s
%(fail)
s
}
}
Py_XDECREF(
%(out)
s);
Py_XDECREF(
%(out)
s);
%(out)
s = new_GpuArray((PyObject *)&GpuArrayType, GpuArray_default_context());
%(out)
s = new_GpuArray((PyObject *)&GpuArrayType, GpuArray_default_context()
, Py_None
);
if (
%(out)
s == NULL) {
if (
%(out)
s == NULL) {
Py_DECREF(
%(name)
s_tmp);
Py_DECREF(
%(name)
s_tmp);
// new_GpuArray calls __new__ which will set an error message
// new_GpuArray calls __new__ which will set an error message
...
@@ -191,7 +191,7 @@ class GpuFromHost(Op):
...
@@ -191,7 +191,7 @@ class GpuFromHost(Op):
'out'
:
outputs
[
0
],
'fail'
:
sub
[
'fail'
]}
'out'
:
outputs
[
0
],
'fail'
:
sub
[
'fail'
]}
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
return
(
1
,)
return
(
2
,)
gpu_from_host
=
GpuFromHost
()
gpu_from_host
=
GpuFromHost
()
...
@@ -298,7 +298,7 @@ class GpuFromCuda(Op):
...
@@ -298,7 +298,7 @@ class GpuFromCuda(Op):
}
}
Py_XDECREF(
%(out)
s);
Py_XDECREF(
%(out)
s);
%(out)
s = new_GpuArray((PyObject *)&GpuArrayType, GpuArray_default_context());
%(out)
s = new_GpuArray((PyObject *)&GpuArrayType, GpuArray_default_context()
, Py_None
);
if (
%(out)
s == NULL) {
if (
%(out)
s == NULL) {
free(
%(name)
sdims);
free(
%(name)
sdims);
free(
%(name)
sstr);
free(
%(name)
sstr);
...
@@ -332,7 +332,7 @@ class GpuFromCuda(Op):
...
@@ -332,7 +332,7 @@ class GpuFromCuda(Op):
'fail'
:
sub
[
'fail'
]}
'fail'
:
sub
[
'fail'
]}
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
return
(
1
,)
return
(
2
,)
gpu_from_cuda
=
GpuFromCuda
()
gpu_from_cuda
=
GpuFromCuda
()
...
...
theano/sandbox/gpuarray/elemwise.py
浏览文件 @
a1bbaede
...
@@ -264,7 +264,7 @@ class GpuDimShuffle(DimShuffle):
...
@@ -264,7 +264,7 @@ class GpuDimShuffle(DimShuffle):
}
}
Py_XDECREF(
%(out)
s);
Py_XDECREF(
%(out)
s);
%(out)
s = new_GpuArray((PyObject *)&GpuArrayType, GpuArray_default_context());
%(out)
s = new_GpuArray((PyObject *)&GpuArrayType, GpuArray_default_context()
, Py_None
);
if (
%(out)
s == NULL) {
%(fail)
s}
if (
%(out)
s == NULL) {
%(fail)
s}
if (
%(name)
s_f(
%(out)
s,
%(inp)
s)) {
if (
%(name)
s_f(
%(out)
s,
%(inp)
s)) {
...
@@ -289,4 +289,4 @@ class GpuDimShuffle(DimShuffle):
...
@@ -289,4 +289,4 @@ class GpuDimShuffle(DimShuffle):
return
process
return
process
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
return
(
0
,)
return
(
1
,)
theano/sandbox/gpuarray/subtensor.py
浏览文件 @
a1bbaede
...
@@ -77,7 +77,7 @@ class GpuSubtensor(Subtensor):
...
@@ -77,7 +77,7 @@ class GpuSubtensor(Subtensor):
// Try to reuse the python object.
// Try to reuse the python object.
GpuArray_clear(&
%(out)
s->ga);
GpuArray_clear(&
%(out)
s->ga);
} else {
} else {
%(out)
s = new_GpuArray((PyObject *)&GpuArrayType, GpuArray_default_context);
%(out)
s = new_GpuArray((PyObject *)&GpuArrayType, GpuArray_default_context
, Py_None
);
}
}
if (!
%(out)
s) {
%(fail)
s }
if (!
%(out)
s) {
%(fail)
s }
int
%(name)
s_err;
int
%(name)
s_err;
...
@@ -94,15 +94,4 @@ class GpuSubtensor(Subtensor):
...
@@ -94,15 +94,4 @@ class GpuSubtensor(Subtensor):
return
sio
.
getvalue
()
return
sio
.
getvalue
()
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
return
(
0
,)
return
(
1
,)
def
grad
(
self
,
inputs
,
grads
):
gz
,
=
grads
x
=
inputs
[
0
]
rest
=
inputs
[
1
:]
output
=
self
(
*
inputs
)
if
output
.
dtype
.
find
(
'int'
)
!=
-
1
:
first
=
x
.
zeros_like
(
theano
.
config
.
floatX
)
else
:
first
=
GpuIncSubtensor
(
self
.
idx_list
)(
x
.
zeros_like
(),
gz
,
*
rest
)
return
([
first
]
+
[
DisconnectedType
()()]
*
len
(
rest
))
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论