Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
f6d8ab54
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
f6d8ab54
编写于
8月 16, 2021
作者:
Z
zhangchunle
提交者:
GitHub
8月 16, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix iscan bug in test file (#34912)
上级
3b9f040d
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
16 addition
and
304 deletion
+16
-304
python/paddle/fluid/contrib/slim/tests/test_imperative_out_scale.py
...dle/fluid/contrib/slim/tests/test_imperative_out_scale.py
+1
-1
python/paddle/fluid/incubate/fleet/base/fleet_base.py
python/paddle/fluid/incubate/fleet/base/fleet_base.py
+0
-9
python/paddle/fluid/tests/unittests/dist_sharding_save.py
python/paddle/fluid/tests/unittests/dist_sharding_save.py
+1
-1
python/paddle/fluid/tests/unittests/mkldnn/test_reshape_mkldnn_op.py
...le/fluid/tests/unittests/mkldnn/test_reshape_mkldnn_op.py
+1
-1
python/paddle/fluid/tests/unittests/test_dist_fleet_grad_clip.py
...paddle/fluid/tests/unittests/test_dist_fleet_grad_clip.py
+1
-1
python/paddle/fluid/tests/unittests/test_fleet_base_3.py
python/paddle/fluid/tests/unittests/test_fleet_base_3.py
+1
-1
python/paddle/fluid/tests/unittests/test_fleet_rolemaker_new.py
.../paddle/fluid/tests/unittests/test_fleet_rolemaker_new.py
+0
-258
python/paddle/fluid/tests/unittests/test_layers.py
python/paddle/fluid/tests/unittests/test_layers.py
+4
-4
python/paddle/fluid/tests/unittests/test_matmul_op.py
python/paddle/fluid/tests/unittests/test_matmul_op.py
+5
-5
python/paddle/fluid/tests/unittests/test_parallel_dygraph_pipeline_parallel.py
...ests/unittests/test_parallel_dygraph_pipeline_parallel.py
+2
-2
python/paddle/fluid/tests/unittests/test_reduce_op.py
python/paddle/fluid/tests/unittests/test_reduce_op.py
+0
-18
python/paddle/fluid/tests/unittests/test_sum_op.py
python/paddle/fluid/tests/unittests/test_sum_op.py
+0
-3
未找到文件。
python/paddle/fluid/contrib/slim/tests/test_imperative_out_scale.py
浏览文件 @
f6d8ab54
...
...
@@ -35,7 +35,7 @@ from paddle.nn import Linear, Conv2D, Softmax, BatchNorm2D, MaxPool2D
from
paddle.fluid.log_helper
import
get_logger
from
paddle.fluid.dygraph
import
nn
from
imperative_test_utils
import
fix_model_dict
,
train_lenet
,
ImperativeLenet
from
imperative_test_utils
import
fix_model_dict
,
train_lenet
paddle
.
enable_static
()
...
...
python/paddle/fluid/incubate/fleet/base/fleet_base.py
浏览文件 @
f6d8ab54
...
...
@@ -26,15 +26,6 @@ from paddle.distributed.fleet.base.role_maker import RoleMakerBase
from
paddle.fluid.contrib.mixed_precision.decorator
import
OptimizerWithMixedPrecision
from
.
import
mode
class
Mode
:
"""
There are various mode for fleet, each of them is designed for different model.
"""
PS
=
1
COLLECTIVE
=
2
__all__
=
[
'Fleet'
,
'DistributedOptimizer'
]
__all__
+=
mode
.
__all__
...
...
python/paddle/fluid/tests/unittests/dist_sharding_save.py
浏览文件 @
f6d8ab54
...
...
@@ -16,7 +16,7 @@ from __future__ import print_function
import
paddle
import
paddle.fluid
as
fluid
from
test_dist_base
import
TestDistRunnerBase
,
runtime_main
from
test_dist_base
import
TestDistRunnerBase
from
dist_mnist
import
cnn_model
# from paddle.fluid.incubate.fleet.collective import fleet
import
paddle.distributed.fleet
as
fleet
...
...
python/paddle/fluid/tests/unittests/mkldnn/test_reshape_mkldnn_op.py
浏览文件 @
f6d8ab54
...
...
@@ -85,7 +85,7 @@ class TestReshape2OneDNNOpDimInfer2(TestReshape2OneDNNOp):
'XShape'
:
np
.
random
.
random
(
self
.
ori_shape
).
astype
(
"float32"
)
}
def
init_data
(
self
):
def
init_data
1
(
self
):
self
.
ori_shape
=
(
6
,
20
)
self
.
new_shape
=
(
0
,
-
1
,
20
)
self
.
actual_shape
=
(
2
,
3
,
20
)
...
...
python/paddle/fluid/tests/unittests/test_dist_fleet_grad_clip.py
浏览文件 @
f6d8ab54
...
...
@@ -46,7 +46,7 @@ class TestDistGeoClipByGlobalNorm(TestFleetBase):
self
.
check_with_place
(
"dist_fleet_ctr.py"
,
delta
=
1e-5
,
check_error_log
=
True
)
def
_setup_config
(
self
):
def
_setup_config
1
(
self
):
self
.
_sync_mode
=
False
self
.
_grad_clip_mode
=
2
...
...
python/paddle/fluid/tests/unittests/test_fleet_base_3.py
浏览文件 @
f6d8ab54
...
...
@@ -21,7 +21,7 @@ import paddle.fluid as fluid
paddle
.
enable_static
()
class
TestFleetBase
(
unittest
.
TestCase
):
class
TestFleetBase
_1
(
unittest
.
TestCase
):
def
setUp
(
self
):
os
.
environ
[
"POD_IP"
]
=
"127.0.0.1"
os
.
environ
[
"PADDLE_TRAINER_ENDPOINTS"
]
=
"127.0.0.1:36001"
...
...
python/paddle/fluid/tests/unittests/test_fleet_rolemaker_new.py
浏览文件 @
f6d8ab54
...
...
@@ -268,264 +268,6 @@ class TestGlooWithCloudRoleMaker(unittest.TestCase):
self
.
case
(
role
,
"server"
)
self
.
clean
(
tmp
)
def
test_fs_gloo4
(
self
):
plats
=
platform
.
platform
()
if
'Linux'
not
in
plats
:
print
(
"skip gloo UT on MacOS/Win"
)
return
os
.
environ
[
"TRAINING_ROLE"
]
=
"WORKER"
os
.
environ
[
"PADDLE_PSERVERS_IP_PORT_LIST"
]
=
"127.0.0.1:36001"
os
.
environ
[
"POD_IP"
]
=
"127.0.0.1"
os
.
environ
[
"PADDLE_PORT"
]
=
"36001"
os
.
environ
[
"SYS_JOB_ID"
]
=
"gloo_for_cluster"
os
.
environ
[
"PADDLE_WITH_GLOO"
]
=
"1"
os
.
environ
[
"PADDLE_GLOO_RENDEZVOUS"
]
=
"3"
os
.
environ
[
"PADDLE_GLOO_HTTP_ENDPOINT"
]
=
"127.0.0.1:30019"
role
=
role_maker
.
PaddleCloudRoleMaker
(
is_collecitve
=
True
)
role
.
_generate_role
()
import
time
time
.
sleep
(
3
)
def
test_fs_gloo5
(
self
):
plats
=
platform
.
platform
()
if
'Linux'
not
in
plats
:
print
(
"skip gloo UT on MacOS/Win"
)
return
tmp
=
self
.
mkdir
()
os
.
environ
[
"TRAINING_ROLE"
]
=
"PSERVER"
os
.
environ
[
"PADDLE_PSERVERS_IP_PORT_LIST"
]
=
"127.0.0.1:36001"
os
.
environ
[
"POD_IP"
]
=
"127.0.0.1"
os
.
environ
[
"PADDLE_PORT"
]
=
"36001"
os
.
environ
[
"PADDLE_TRAINERS_NUM"
]
=
"0"
os
.
environ
[
"SYS_JOB_ID"
]
=
"gloo_for_cluster"
os
.
environ
[
"PADDLE_WITH_GLOO"
]
=
"2"
os
.
environ
[
"PADDLE_GLOO_RENDEZVOUS"
]
=
"2"
os
.
environ
[
"PADDLE_GLOO_FS_PATH"
]
=
tmp
role
=
role_maker
.
PaddleCloudRoleMaker
()
role
.
_generate_role
()
self
.
case
(
role
,
"server"
)
self
.
case
(
role
,
"all"
)
self
.
clean
(
tmp
)
def
test_fs_gloo6
(
self
):
plats
=
platform
.
platform
()
if
'Linux'
not
in
plats
:
print
(
"skip gloo UT on MacOS/Win"
)
return
tmp
=
self
.
mkdir
()
os
.
environ
[
"TRAINING_ROLE"
]
=
"PSERVER"
os
.
environ
[
"PADDLE_PSERVERS_IP_PORT_LIST"
]
=
"127.0.0.1:36001"
os
.
environ
[
"POD_IP"
]
=
"127.0.0.1"
os
.
environ
[
"PADDLE_PORT"
]
=
"36001"
os
.
environ
[
"PADDLE_TRAINERS_NUM"
]
=
"0"
os
.
environ
[
"SYS_JOB_ID"
]
=
"gloo_for_cluster"
os
.
environ
[
"PADDLE_WITH_GLOO"
]
=
"2"
os
.
environ
[
"PADDLE_GLOO_RENDEZVOUS"
]
=
"1"
os
.
environ
[
"PADDLE_GLOO_FS_NAME"
]
=
"NULL"
os
.
environ
[
"PADDLE_GLOO_FS_UGI"
]
=
"NULL"
os
.
environ
[
"PADDLE_GLOO_FS_PATH"
]
=
tmp
role
=
role_maker
.
PaddleCloudRoleMaker
()
role
.
_generate_role
()
self
.
case
(
role
,
"server"
)
self
.
case
(
role
,
"all"
)
self
.
clean
(
tmp
)
def
test_fs_gloo7
(
self
):
plats
=
platform
.
platform
()
if
'Linux'
not
in
plats
:
print
(
"skip gloo UT on MacOS/Win"
)
return
os
.
environ
[
"TRAINING_ROLE"
]
=
"PSERVER"
os
.
environ
[
"PADDLE_PSERVERS_IP_PORT_LIST"
]
=
"127.0.0.1:36001"
os
.
environ
[
"POD_IP"
]
=
"127.0.0.1"
os
.
environ
[
"PADDLE_PORT"
]
=
"36001"
os
.
environ
[
"PADDLE_TRAINERS_NUM"
]
=
"0"
os
.
environ
[
"SYS_JOB_ID"
]
=
"gloo_for_cluster"
os
.
environ
[
"PADDLE_WITH_GLOO"
]
=
"1"
os
.
environ
[
"PADDLE_GLOO_RENDEZVOUS"
]
=
"5"
role
=
role_maker
.
PaddleCloudRoleMaker
()
self
.
assertRaises
(
ValueError
,
role
.
_generate_role
)
def
test_fs_gloo8
(
self
):
plats
=
platform
.
platform
()
if
'Linux'
not
in
plats
:
print
(
"skip gloo UT on MacOS/Win"
)
return
tmp
=
self
.
mkdir
()
os
.
environ
[
"TRAINING_ROLE"
]
=
"PSERVER"
os
.
environ
[
"PADDLE_PSERVERS_IP_PORT_LIST"
]
=
"127.0.0.1:36001"
os
.
environ
[
"POD_IP"
]
=
"127.0.0.1"
os
.
environ
[
"PADDLE_PORT"
]
=
"36001"
os
.
environ
[
"PADDLE_TRAINERS_NUM"
]
=
"0"
os
.
environ
[
"SYS_JOB_ID"
]
=
"gloo_for_cluster"
os
.
environ
[
"PADDLE_WITH_GLOO"
]
=
"2"
os
.
environ
[
"PADDLE_GLOO_RENDEZVOUS"
]
=
"1"
os
.
environ
[
"PADDLE_GLOO_FS_NAME"
]
=
"NULL"
os
.
environ
[
"PADDLE_GLOO_FS_UGI"
]
=
"NULL"
os
.
environ
[
"PADDLE_GLOO_FS_PATH"
]
=
tmp
def
net
():
x
=
paddle
.
fluid
.
layers
.
data
(
name
=
'x'
,
shape
=
[
13
],
dtype
=
'float32'
)
y_predict
=
paddle
.
fluid
.
layers
.
fc
(
input
=
x
,
size
=
1
,
act
=
None
)
y
=
paddle
.
fluid
.
layers
.
data
(
name
=
'y'
,
shape
=
[
1
],
dtype
=
'float32'
)
cost
=
paddle
.
fluid
.
layers
.
square_error_cost
(
input
=
y_predict
,
label
=
y
)
avg_cost
=
paddle
.
fluid
.
layers
.
mean
(
cost
)
return
avg_cost
from
paddle.distributed
import
fleet
role
=
role_maker
.
PaddleCloudRoleMaker
()
fleet
.
init
(
role
)
avg_cost
=
net
()
strategy
=
paddle
.
distributed
.
fleet
.
DistributedStrategy
()
strategy
.
a_sync
=
False
optimizer
=
paddle
.
optimizer
.
SGD
(
0.01
)
optimizer
=
fleet
.
distributed_optimizer
(
optimizer
,
strategy
)
optimizer
.
minimize
(
avg_cost
)
comm_world
=
"server"
fleet
.
util
.
barrier
(
comm_world
)
gather
=
fleet
.
util
.
all_gather
(
1
,
comm_world
)
self
.
assertEqual
(
gather
[
0
],
1
)
all_reduce
=
fleet
.
util
.
all_reduce
(
1
,
"sum"
,
comm_world
)
self
.
assertEqual
(
1
,
all_reduce
)
self
.
clean
(
tmp
)
class
TestGlooWithCloudRoleMaker
(
unittest
.
TestCase
):
def
setUp
(
self
):
os
.
environ
[
"PADDLE_TRAINERS_NUM"
]
=
"1"
os
.
environ
[
"PADDLE_PSERVERS_IP_PORT_LIST"
]
=
"127.0.0.1:36001"
os
.
environ
[
"PADDLE_TRAINER_ENDPOINTS"
]
=
"127.0.0.1:36001"
os
.
environ
[
"POD_IP"
]
=
"127.0.0.1"
os
.
environ
[
"PADDLE_TRAINER_ID"
]
=
"0"
def
case
(
self
,
role
,
comm_world
):
role
.
_barrier
(
comm_world
)
gather
=
role
.
_all_gather
(
1
,
comm_world
)
self
.
assertEqual
(
gather
[
0
],
1
)
all_reduce
=
role
.
_all_reduce
(
1
,
"sum"
,
comm_world
)
self
.
assertEqual
(
1
,
all_reduce
)
def
mkdir
(
self
):
tmp
=
tempfile
.
mkdtemp
()
return
tmp
def
clean
(
self
,
tmp
):
shutil
.
rmtree
(
tmp
)
def
test_hdfs_gloo
(
self
):
plats
=
platform
.
platform
()
if
'Linux'
not
in
plats
:
print
(
"skip gloo UT on MacOS/Win"
)
return
tmp
=
self
.
mkdir
()
os
.
environ
[
"TRAINING_ROLE"
]
=
"TRAINER"
os
.
environ
[
"SYS_JOB_ID"
]
=
"gloo_for_cluster"
os
.
environ
[
"PADDLE_WITH_GLOO"
]
=
"1"
os
.
environ
[
"PADDLE_GLOO_RENDEZVOUS"
]
=
"1"
os
.
environ
[
"PADDLE_GLOO_FS_NAME"
]
=
"NULL"
os
.
environ
[
"PADDLE_GLOO_FS_UGI"
]
=
"NULL"
os
.
environ
[
"PADDLE_GLOO_FS_PATH"
]
=
tmp
role
=
role_maker
.
PaddleCloudRoleMaker
()
role
.
_generate_role
()
self
.
case
(
role
,
"worker"
)
self
.
clean
(
tmp
)
def
test_fs_gloo
(
self
):
plats
=
platform
.
platform
()
if
'Linux'
not
in
plats
:
print
(
"skip gloo UT on MacOS/Win"
)
return
tmp
=
self
.
mkdir
()
os
.
environ
[
"TRAINING_ROLE"
]
=
"TRAINER"
os
.
environ
[
"SYS_JOB_ID"
]
=
"gloo_for_cluster"
os
.
environ
[
"PADDLE_WITH_GLOO"
]
=
"1"
os
.
environ
[
"PADDLE_GLOO_RENDEZVOUS"
]
=
"2"
os
.
environ
[
"PADDLE_GLOO_FS_PATH"
]
=
tmp
role
=
role_maker
.
PaddleCloudRoleMaker
()
role
.
_generate_role
()
self
.
case
(
role
,
"worker"
)
self
.
clean
(
tmp
)
def
test_fs_gloo2
(
self
):
plats
=
platform
.
platform
()
if
'Linux'
not
in
plats
:
print
(
"skip gloo UT on MacOS/Win"
)
return
tmp
=
self
.
mkdir
()
os
.
environ
[
"TRAINING_ROLE"
]
=
"PSERVER"
os
.
environ
[
"PADDLE_PSERVERS_IP_PORT_LIST"
]
=
"127.0.0.1:36001"
os
.
environ
[
"POD_IP"
]
=
"127.0.0.1"
os
.
environ
[
"PADDLE_PORT"
]
=
"36001"
os
.
environ
[
"SYS_JOB_ID"
]
=
"gloo_for_cluster"
os
.
environ
[
"PADDLE_WITH_GLOO"
]
=
"1"
os
.
environ
[
"PADDLE_GLOO_RENDEZVOUS"
]
=
"2"
os
.
environ
[
"PADDLE_GLOO_FS_PATH"
]
=
tmp
role
=
role_maker
.
PaddleCloudRoleMaker
()
role
.
_generate_role
()
self
.
case
(
role
,
"server"
)
self
.
clean
(
tmp
)
def
test_fs_gloo3
(
self
):
plats
=
platform
.
platform
()
if
'Linux'
not
in
plats
:
print
(
"skip gloo UT on MacOS/Win"
)
return
tmp
=
self
.
mkdir
()
os
.
environ
[
"TRAINING_ROLE"
]
=
"PSERVER"
os
.
environ
[
"PADDLE_PSERVERS_IP_PORT_LIST"
]
=
"127.0.0.1:36001"
os
.
environ
[
"POD_IP"
]
=
"127.0.0.1"
os
.
environ
[
"PADDLE_PORT"
]
=
"36001"
os
.
environ
[
"SYS_JOB_ID"
]
=
"gloo_for_cluster"
os
.
environ
[
"PADDLE_WITH_GLOO"
]
=
"1"
os
.
environ
[
"PADDLE_GLOO_RENDEZVOUS"
]
=
"1"
os
.
environ
[
"PADDLE_GLOO_FS_NAME"
]
=
"NULL"
os
.
environ
[
"PADDLE_GLOO_FS_UGI"
]
=
"NULL"
os
.
environ
[
"PADDLE_GLOO_FS_PATH"
]
=
tmp
role
=
role_maker
.
PaddleCloudRoleMaker
()
role
.
_generate_role
()
self
.
case
(
role
,
"server"
)
self
.
clean
(
tmp
)
def
test_fs_gloo4
(
self
):
plats
=
platform
.
platform
()
if
'Linux'
not
in
plats
:
...
...
python/paddle/fluid/tests/unittests/test_layers.py
浏览文件 @
f6d8ab54
...
...
@@ -1658,20 +1658,20 @@ class TestLayer(LayerTest):
i
=
layers
.
fill_constant
(
shape
=
[
1
],
dtype
=
'int64'
,
value
=
0
)
ten
=
layers
.
fill_constant
(
shape
=
[
1
],
dtype
=
'int64'
,
value
=
10
)
def
cond
(
i
):
def
cond
1
(
i
):
return
layers
.
less_than
(
i
,
ten
)
def
body
(
i
):
def
body
1
(
i
):
return
i
+
1
dy_ret
=
layers
.
while_loop
(
cond
,
body
,
[
i
])
dy_ret
=
layers
.
while_loop
(
cond
1
,
body1
,
[
i
])
with
self
.
assertRaises
(
ValueError
):
j
=
layers
.
fill_constant
(
shape
=
[
1
],
dtype
=
'int64'
,
value
=
0
)
def
body2
(
i
):
return
i
+
1
,
i
+
2
layers
.
while_loop
(
cond
,
body2
,
[
j
])
layers
.
while_loop
(
cond
1
,
body2
,
[
j
])
self
.
assertTrue
(
np
.
array_equal
(
static_ret
[
0
],
dy_ret
[
0
].
numpy
()))
...
...
python/paddle/fluid/tests/unittests/test_matmul_op.py
浏览文件 @
f6d8ab54
...
...
@@ -207,8 +207,8 @@ for dim_X in (1, 2, 3):
# Test case more batch_size and N, M, K
def
generate_compatible_shapes
(
dim_X
,
dim_Y
,
transpose_X
,
transpose_Y
,
batch_size
):
def
generate_compatible_shapes
_batch
(
dim_X
,
dim_Y
,
transpose_X
,
transpose_Y
,
batch_size
):
BATCH_SIZE
=
2
M
=
3
N
=
4
...
...
@@ -243,7 +243,7 @@ def generate_compatible_shapes(dim_X, dim_Y, transpose_X, transpose_Y,
# Test case n-dim
def
generate_compatible_shapes
(
dim
,
transpose_X
,
transpose_Y
):
def
generate_compatible_shapes
_ndim
(
dim
,
transpose_X
,
transpose_Y
):
M
=
2
N
=
4
K
=
3
...
...
@@ -270,8 +270,8 @@ for dim in [4]:
test_name
=
(
'TestMatMulOp_dimX_{}_dim_Y_{}_transX_{}_transY_{}'
.
format
(
dim
,
dim
,
transpose_X
,
transpose_Y
))
shape_X
,
shape_Y
=
generate_compatible_shapes
(
dim
,
transpose_X
,
transpose_Y
)
shape_X
,
shape_Y
=
generate_compatible_shapes
_ndim
(
dim
,
transpose_X
,
transpose_Y
)
globals
()[
test_name
]
=
type
(
test_name
,
(
Generator
,
OpTest
),
{
'shape_X'
:
shape_X
,
'shape_Y'
:
shape_Y
,
...
...
python/paddle/fluid/tests/unittests/test_parallel_dygraph_pipeline_parallel.py
浏览文件 @
f6d8ab54
...
...
@@ -36,10 +36,10 @@ class TestHybridPipeParallel(TestMultipleGpus):
def
test_hybrid_parallel_transformer
(
self
):
self
.
run_mnist_2gpu
(
'hybrid_parallel_pp_transformer.py'
)
def
test_hybrid_parallel_
transformer
(
self
):
def
test_hybrid_parallel_
save_load
(
self
):
self
.
run_mnist_2gpu
(
'hybrid_parallel_pp_save_load.py'
)
def
test_hybrid_parallel_
transformer
(
self
):
def
test_hybrid_parallel_
recompute
(
self
):
self
.
run_mnist_2gpu
(
'hybrid_parallel_pp_recompute.py'
)
...
...
python/paddle/fluid/tests/unittests/test_reduce_op.py
浏览文件 @
f6d8ab54
...
...
@@ -561,24 +561,6 @@ class TestKeepDim8DReduce(Test1DReduce):
}
class
TestReduceAll
(
Test1DReduce
):
def
setUp
(
self
):
self
.
op_type
=
"reduce_sum"
self
.
inputs
=
{
'X'
:
np
.
random
.
random
((
5
,
6
,
2
,
10
)).
astype
(
"float64"
)}
self
.
attrs
=
{
'reduce_all'
:
True
}
self
.
outputs
=
{
'Out'
:
self
.
inputs
[
'X'
].
sum
()}
class
TestReduceAll
(
Test1DReduce
):
def
setUp
(
self
):
self
.
op_type
=
"reduce_sum"
self
.
inputs
=
{
'X'
:
np
.
random
.
random
((
2
,
5
,
3
,
2
,
2
,
3
,
4
,
2
)).
astype
(
"float64"
)
}
self
.
attrs
=
{
'reduce_all'
:
True
,
'dim'
:
(
3
,
4
,
5
)}
self
.
outputs
=
{
'Out'
:
self
.
inputs
[
'X'
].
sum
(
axis
=
self
.
attrs
[
'dim'
])}
@
skip_check_grad_ci
(
reason
=
"reduce_max is discontinuous non-derivable function,"
" its gradient check is not supported by unittest framework."
)
...
...
python/paddle/fluid/tests/unittests/test_sum_op.py
浏览文件 @
f6d8ab54
...
...
@@ -49,9 +49,6 @@ class TestSumOp(OpTest):
def
test_check_grad
(
self
):
self
.
check_grad
([
'x0'
],
'Out'
)
def
init_kernel_type
(
self
):
pass
class
TestSelectedRowsSumOp
(
unittest
.
TestCase
):
def
setUp
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录