Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
66bb1edf
提交
66bb1edf
authored
10月 18, 2015
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CRASH] during opt with Eye when k!=0
上级
1b81a00e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
11 行增加
和
6 行删除
+11
-6
opt.py
theano/sandbox/cuda/opt.py
+4
-1
test_basic_ops.py
theano/sandbox/cuda/tests/test_basic_ops.py
+7
-5
没有找到文件。
theano/sandbox/cuda/opt.py
浏览文件 @
66bb1edf
...
@@ -2233,11 +2233,14 @@ def local_gpu_eye(node):
...
@@ -2233,11 +2233,14 @@ def local_gpu_eye(node):
if
(
host_input
.
owner
and
if
(
host_input
.
owner
and
isinstance
(
host_input
.
owner
.
op
,
tensor
.
Eye
)
and
isinstance
(
host_input
.
owner
.
op
,
tensor
.
Eye
)
and
host_input
.
owner
.
op
.
dtype
==
"float32"
):
host_input
.
owner
.
op
.
dtype
==
"float32"
):
if
tensor
.
extract_constant
(
host_input
.
owner
.
inputs
[
2
])
!=
0
:
return
return
[
gpu_eye
(
*
host_input
.
owner
.
inputs
)]
return
[
gpu_eye
(
*
host_input
.
owner
.
inputs
)]
if
isinstance
(
node
.
op
,
tensor
.
Eye
)
and
node
.
op
.
dtype
==
"float32"
:
if
isinstance
(
node
.
op
,
tensor
.
Eye
)
and
node
.
op
.
dtype
==
"float32"
:
if
any
([(
i
.
owner
and
isinstance
(
i
.
owner
.
op
,
HostFromGpu
))
if
any
([(
i
.
owner
and
isinstance
(
i
.
owner
.
op
,
HostFromGpu
))
for
i
in
node
.
inputs
]):
for
i
in
node
.
inputs
]):
if
tensor
.
extract_constant
(
node
.
inputs
[
2
])
!=
0
:
return
return
[
host_from_gpu
(
gpu_eye
(
*
node
.
inputs
))]
return
[
host_from_gpu
(
gpu_eye
(
*
node
.
inputs
))]
return
False
return
False
...
...
theano/sandbox/cuda/tests/test_basic_ops.py
浏览文件 @
66bb1edf
...
@@ -1224,7 +1224,7 @@ def test_shared_cudandarray():
...
@@ -1224,7 +1224,7 @@ def test_shared_cudandarray():
def
test_gpueye
():
def
test_gpueye
():
def
check
(
dtype
,
N
,
M_
=
None
):
def
check
(
dtype
,
N
,
M_
=
None
,
K
=
0
):
# Theano does not accept None as a tensor.
# Theano does not accept None as a tensor.
# So we must use a real value.
# So we must use a real value.
M
=
M_
M
=
M_
...
@@ -1234,22 +1234,24 @@ def test_gpueye():
...
@@ -1234,22 +1234,24 @@ def test_gpueye():
M
=
N
M
=
N
N_symb
=
T
.
iscalar
()
N_symb
=
T
.
iscalar
()
M_symb
=
T
.
iscalar
()
M_symb
=
T
.
iscalar
()
k_symb
=
numpy
.
asarray
(
0
)
k_symb
=
numpy
.
asarray
(
K
)
out
=
T
.
eye
(
N_symb
,
M_symb
,
k_symb
,
dtype
=
dtype
)
out
=
T
.
eye
(
N_symb
,
M_symb
,
k_symb
,
dtype
=
dtype
)
f
=
theano
.
function
([
N_symb
,
M_symb
],
f
=
theano
.
function
([
N_symb
,
M_symb
],
B
.
as_cuda_ndarray_variable
(
out
),
B
.
as_cuda_ndarray_variable
(
out
),
mode
=
mode_with_gpu
)
mode
=
mode_with_gpu
)
result
=
numpy
.
asarray
(
f
(
N
,
M
))
result
=
numpy
.
asarray
(
f
(
N
,
M
))
utt
.
assert_allclose
(
result
,
numpy
.
eye
(
N
,
M_
,
dtype
=
dtype
))
utt
.
assert_allclose
(
result
,
numpy
.
eye
(
N
,
M_
,
K
,
dtype
=
dtype
))
assert
result
.
dtype
==
numpy
.
dtype
(
dtype
)
assert
result
.
dtype
==
numpy
.
dtype
(
dtype
)
assert
any
([
isinstance
(
node
.
op
,
B
.
GpuEye
)
if
K
==
0
:
for
node
in
f
.
maker
.
fgraph
.
toposort
()])
assert
any
([
isinstance
(
node
.
op
,
B
.
GpuEye
)
for
node
in
f
.
maker
.
fgraph
.
toposort
()])
for
dtype
in
[
'float32'
]:
for
dtype
in
[
'float32'
]:
yield
check
,
dtype
,
3
yield
check
,
dtype
,
3
# M != N, k = 0
# M != N, k = 0
yield
check
,
dtype
,
3
,
5
yield
check
,
dtype
,
3
,
5
yield
check
,
dtype
,
5
,
3
yield
check
,
dtype
,
5
,
3
yield
check
,
dtype
,
5
,
3
,
1
class
test_size
(
unittest
.
TestCase
):
class
test_size
(
unittest
.
TestCase
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论