Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
da3df882
提交
da3df882
authored
5月 12, 2015
作者:
Frédéric Bastien
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2896 from abergeron/fix_advsub
Fix crashes in the gpuarray test suite.
上级
94e31183
3bfef993
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
16 行增加
和
10 行删除
+16
-10
basic_ops.py
theano/sandbox/gpuarray/basic_ops.py
+15
-2
test_basic_ops.py
theano/sandbox/gpuarray/tests/test_basic_ops.py
+1
-1
test_conv_cuda_ndarray.py
theano/sandbox/gpuarray/tests/test_conv_cuda_ndarray.py
+0
-7
没有找到文件。
theano/sandbox/gpuarray/basic_ops.py
浏览文件 @
da3df882
...
@@ -835,7 +835,7 @@ class GpuJoin(HideC, Join):
...
@@ -835,7 +835,7 @@ class GpuJoin(HideC, Join):
node
.
outputs
[
0
]
.
dtype
)
node
.
outputs
[
0
]
.
dtype
)
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
return
(
1
,)
return
(
2
,)
def
c_code
(
self
,
node
,
name
,
inputs
,
out_
,
sub
):
def
c_code
(
self
,
node
,
name
,
inputs
,
out_
,
sub
):
copy_to_list
=
[]
copy_to_list
=
[]
...
@@ -851,9 +851,22 @@ if (als == NULL) {
...
@@ -851,9 +851,22 @@ if (als == NULL) {
}
}
%(copy_inputs_to_list)
s
%(copy_inputs_to_list)
s
Py_XDECREF(
%(out)
s);
Py_XDECREF(
%(out)
s);
%(out)
s = pygpu_concatenate(als,
%(n)
s, PyInt_AsLong((PyObject *)
%(axis)
s),
{
int axis = PyInt_AsLong((PyObject *)
%(axis)
s);
if (axis < 0) {
if (axis == -1 && PyErr_Occurred()) {
%(fail)
s
}
axis += als[0]->nd;
if (axis < 0) {
PyErr_SetString(PyExc_IndexError, "invalid axis");
%(fail)
s
}
}
%(out)
s = pygpu_concatenate(als,
%(n)
s, axis,
%(restype)
s, (PyObject *)&PyGpuArrayType,
%(restype)
s, (PyObject *)&PyGpuArrayType,
pygpu_default_context());
pygpu_default_context());
}
PyMem_Free(als);
PyMem_Free(als);
if (
%(out)
s == NULL)
if (
%(out)
s == NULL)
%(fail)
s
%(fail)
s
...
...
theano/sandbox/gpuarray/tests/test_basic_ops.py
浏览文件 @
da3df882
...
@@ -302,7 +302,7 @@ GpuAllocTester = makeTester(
...
@@ -302,7 +302,7 @@ GpuAllocTester = makeTester(
)
)
class
TestAlloc
(
t
heano
.
tensor
.
tests
.
t
est_basic
.
TestAlloc
):
class
TestAlloc
(
test_basic
.
TestAlloc
):
dtype
=
"float32"
dtype
=
"float32"
mode
=
mode_with_gpu
mode
=
mode_with_gpu
shared
=
staticmethod
(
gpuarray_shared_constructor
)
shared
=
staticmethod
(
gpuarray_shared_constructor
)
...
...
theano/sandbox/gpuarray/tests/test_conv_cuda_ndarray.py
浏览文件 @
da3df882
...
@@ -29,13 +29,6 @@ from ..conv import GpuConv
...
@@ -29,13 +29,6 @@ from ..conv import GpuConv
import
pygpu
import
pygpu
gftensor4
=
GpuArrayType
(
'float32'
,
[
False
]
*
4
)
gftensor4
=
GpuArrayType
(
'float32'
,
[
False
]
*
4
)
device_id
=
theano
.
sandbox
.
cuda
.
use
.
device_number
# TODO do with with the new back-end.
from
theano.sandbox.cuda
import
cuda_ndarray
cuda_ndarray
=
theano
.
sandbox
.
cuda
.
cuda_ndarray
.
cuda_ndarray
device_prop
=
cuda_ndarray
.
device_properties
(
device_id
)
def
py_conv_valid_numpy
(
img
,
kern
):
def
py_conv_valid_numpy
(
img
,
kern
):
assert
img
.
shape
[
1
]
==
kern
.
shape
[
1
]
assert
img
.
shape
[
1
]
==
kern
.
shape
[
1
]
outshp
=
(
img
.
shape
[
0
],
kern
.
shape
[
0
],
outshp
=
(
img
.
shape
[
0
],
kern
.
shape
[
0
],
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论