Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4de5d0c5
提交
4de5d0c5
authored
8月 16, 2016
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update ellipsis indexing test for GPU
We have to make the distinction between Op types in the original and optimized graph
上级
fba43e24
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
18 行增加
和
12 行删除
+18
-12
test_subtensor.py
theano/gpuarray/tests/test_subtensor.py
+2
-0
test_basic_ops.py
theano/sandbox/cuda/tests/test_basic_ops.py
+1
-0
test_subtensor.py
theano/tensor/tests/test_subtensor.py
+15
-12
没有找到文件。
theano/gpuarray/tests/test_subtensor.py
浏览文件 @
4de5d0c5
...
...
@@ -7,6 +7,7 @@ from theano.compile import DeepCopyOp
from
theano.tensor.tests
import
test_subtensor
from
..basic_ops
import
HostFromGpu
,
GpuFromHost
from
..elemwise
import
GpuDimShuffle
from
..subtensor
import
(
GpuIncSubtensor
,
GpuSubtensor
,
GpuAdvancedSubtensor1
,
GpuAdvancedIncSubtensor1
)
...
...
@@ -27,6 +28,7 @@ class G_subtensor(test_subtensor.T_subtensor):
inc_sub
=
GpuIncSubtensor
,
adv_sub1
=
GpuAdvancedSubtensor1
,
adv_incsub1
=
GpuAdvancedIncSubtensor1
,
dimshuffle
=
GpuDimShuffle
,
mode
=
mode_with_gpu
,
# avoid errors with limited devices
dtype
=
'float32'
,
...
...
theano/sandbox/cuda/tests/test_basic_ops.py
浏览文件 @
4de5d0c5
...
...
@@ -1014,6 +1014,7 @@ class T_subtensor(theano.tensor.tests.test_subtensor.T_subtensor):
inc_sub
=
cuda
.
GpuIncSubtensor
adv_sub1
=
cuda
.
GpuAdvancedSubtensor1
adv_incsub1
=
cuda
.
GpuAdvancedIncSubtensor1
dimshuffle
=
cuda
.
GpuDimShuffle
mode
=
mode_with_gpu
dtype
=
'float32'
type
=
tcn
.
CudaNdarrayType
...
...
theano/tensor/tests/test_subtensor.py
浏览文件 @
4de5d0c5
...
...
@@ -58,12 +58,14 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin):
mode
=
None
,
dtype
=
theano
.
config
.
floatX
,
type
=
tensor
.
TensorType
,
ignore_topo
=
DeepCopyOp
):
ignore_topo
=
DeepCopyOp
,
dimshuffle
=
DimShuffle
):
self
.
shared
=
shared
self
.
sub
=
sub
self
.
inc_sub
=
inc_sub
self
.
adv_sub1
=
adv_sub1
self
.
adv_incsub1
=
adv_incsub1
self
.
dimshuffle
=
dimshuffle
if
mode
is
None
:
mode
=
theano
.
compile
.
mode
.
get_default_mode
()
mode
=
mode
.
including
(
"local_useless_subtensor"
)
...
...
@@ -343,28 +345,29 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin):
numpy_n
=
numpy
.
arange
(
24
,
dtype
=
self
.
dtype
)
.
reshape
((
2
,
3
,
4
))
n
=
self
.
shared
(
numpy_n
)
test_cases
=
[
(
0
,
self
.
sub
,
numpy
.
index_exp
[
...
]),
(
1
,
self
.
sub
,
numpy
.
index_exp
[
...
,
1
]),
(
1
,
self
.
sub
,
numpy
.
index_exp
[
1
,
...
]),
(
1
,
self
.
sub
,
numpy
.
index_exp
[
...
,
1
,
2
,
3
]),
(
1
,
self
.
sub
,
numpy
.
index_exp
[
1
,
...
,
2
,
3
]),
(
1
,
self
.
sub
,
numpy
.
index_exp
[
1
,
2
,
3
,
...
]),
(
3
,
DimShuffle
,
numpy
.
index_exp
[
...
,
[
0
,
2
,
3
]]),
(
1
,
DimShuffle
,
(
0
,
Subtensor
,
self
.
sub
,
numpy
.
index_exp
[
...
]),
(
1
,
Subtensor
,
self
.
sub
,
numpy
.
index_exp
[
...
,
1
]),
(
1
,
Subtensor
,
self
.
sub
,
numpy
.
index_exp
[
1
,
...
]),
(
1
,
Subtensor
,
self
.
sub
,
numpy
.
index_exp
[
...
,
1
,
2
,
3
]),
(
1
,
Subtensor
,
self
.
sub
,
numpy
.
index_exp
[
1
,
...
,
2
,
3
]),
(
1
,
Subtensor
,
self
.
sub
,
numpy
.
index_exp
[
1
,
2
,
3
,
...
]),
(
3
,
DimShuffle
,
self
.
dimshuffle
,
numpy
.
index_exp
[
...
,
[
0
,
2
,
3
]]),
(
1
,
DimShuffle
,
self
.
dimshuffle
,
numpy
.
index_exp
[
numpy
.
newaxis
,
...
])]
# The following test case is not supported by numpy before 1.9
numpy_version
=
[
int
(
v
)
for
v
in
numpy
.
version
.
version
.
split
(
'.'
)[
0
:
2
]]
if
numpy_version
>=
[
1
,
9
]:
test_cases
.
append
(
(
1
,
AdvancedSubtensor
,
(
1
,
AdvancedSubtensor
,
AdvancedSubtensor
,
numpy
.
index_exp
[
...
,
numpy
.
newaxis
,
[
1
,
2
]]))
for
length
,
op_type
,
slice_
in
test_cases
:
for
length
,
op_type
,
op_type_opt
,
slice_
in
test_cases
:
numpy_tval
=
numpy_n
[
slice_
]
t
=
n
[
slice_
]
self
.
assertTrue
(
isinstance
(
t
.
owner
.
op
,
op_type
))
tval
=
self
.
eval_output_and_check
(
t
,
op_type
=
op_type
,
op_type
=
op_type
_opt
,
length
=
length
)
assert_equal
(
tval
.
shape
,
numpy_tval
.
shape
)
assert_array_equal
(
tval
,
numpy_tval
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论