Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
9d5789bd
提交
9d5789bd
authored
10月 20, 2017
作者:
notoraptor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace test_local_gpu_elemwise_careduce with test_dnn_reduction_sum_squares in test_opt.
上级
8655069d
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
13 行增加
和
31 行删除
+13
-31
test_dnn.py
theano/gpuarray/tests/test_dnn.py
+0
-13
test_opt.py
theano/gpuarray/tests/test_opt.py
+13
-18
没有找到文件。
theano/gpuarray/tests/test_dnn.py
浏览文件 @
9d5789bd
...
...
@@ -1569,19 +1569,6 @@ def test_dnn_reduction_opt():
yield
dnn_reduction
,
2
,
idtype
,
adtype
,
odtype
def
test_dnn_reduction_sum_squares
():
if
not
dnn
.
dnn_available
(
test_ctx_name
)
or
dnn
.
version
(
raises
=
False
)
<
6000
:
raise
SkipTest
(
dnn
.
dnn_available
.
msg
)
M
=
T
.
matrix
()
out
=
(
M
**
2
)
.
sum
()
f
=
theano
.
function
([
M
],
out
,
mode
=
mode_with_gpu
)
assert
any
(
isinstance
(
node
.
op
,
dnn
.
GpuDnnReduction
)
and
node
.
op
.
red_op
==
'norm2'
for
node
in
f
.
maker
.
fgraph
.
apply_nodes
)
M_val
=
np
.
random
.
random
((
4
,
5
))
.
astype
(
theano
.
config
.
floatX
)
utt
.
assert_allclose
((
M_val
**
2
)
.
sum
(),
f
(
M_val
))
def
dnn_reduction_strides
(
shp
,
shuffle
,
slice
):
utt
.
fetch_seed
()
inp
=
GpuArrayType
(
'float32'
,
(
False
,)
*
len
(
shp
),
...
...
theano/gpuarray/tests/test_opt.py
浏览文件 @
9d5789bd
...
...
@@ -359,24 +359,19 @@ def test_pdbbreakpoint_op():
assert
_check_stack_trace
(
f
)
def
test_local_gpu_elemwise_careduce
():
x
=
theano
.
tensor
.
matrix
()
o
=
(
x
*
x
)
.
sum
()
f
=
theano
.
function
([
x
],
o
,
mode
=
mode_with_gpu
)
topo
=
f
.
maker
.
fgraph
.
toposort
()
assert
len
(
topo
)
==
3
assert
topo
[
1
]
.
op
.
pre_scalar_op
==
theano
.
scalar
.
sqr
assert
_check_stack_trace
(
f
)
data
=
np
.
random
.
rand
(
3
,
4
)
.
astype
(
theano
.
config
.
floatX
)
utt
.
assert_allclose
(
f
(
data
),
(
data
*
data
)
.
sum
())
o
=
(
x
*
x
)
.
sum
(
axis
=
1
)
f
=
theano
.
function
([
x
],
o
,
mode
=
mode_with_gpu
)
topo
=
f
.
maker
.
fgraph
.
toposort
()
assert
len
(
topo
)
==
3
assert
topo
[
1
]
.
op
.
pre_scalar_op
==
theano
.
scalar
.
sqr
assert
_check_stack_trace
(
f
)
utt
.
assert_allclose
(
f
(
data
),
(
data
*
data
)
.
sum
(
axis
=
1
))
def
test_dnn_reduction_sum_squares
():
if
not
dnn
.
dnn_available
(
test_ctx_name
)
or
dnn
.
version
(
raises
=
False
)
<
6000
:
raise
SkipTest
(
dnn
.
dnn_available
.
msg
)
M
=
tensor
.
matrix
()
for
axis
in
(
None
,
0
,
1
):
out
=
(
M
**
2
)
.
sum
(
axis
=
axis
)
f
=
theano
.
function
([
M
],
out
,
mode
=
mode_with_gpu
)
assert
any
(
isinstance
(
node
.
op
,
dnn
.
GpuDnnReduction
)
and
node
.
op
.
red_op
==
'norm2'
for
node
in
f
.
maker
.
fgraph
.
apply_nodes
)
assert
_check_stack_trace
(
f
)
M_val
=
np
.
random
.
random
((
4
,
5
))
.
astype
(
theano
.
config
.
floatX
)
utt
.
assert_allclose
((
M_val
**
2
)
.
sum
(
axis
=
axis
),
f
(
M_val
))
def
test_local_lift_dot22scalar
():
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论