Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
89bd4011
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
89bd4011
编写于
12月 05, 2022
作者:
N
Nyakku Shigure
提交者:
GitHub
12月 05, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CodeStyle][E401][F811] remove redefined imports and variables (#48538)
上级
e707ee53
变更
61
隐藏空白更改
内联
并排
Showing
61 changed file
with
32 addition
and
93 deletion
+32
-93
.flake8
.flake8
+8
-2
python/paddle/autograd/__init__.py
python/paddle/autograd/__init__.py
+0
-2
python/paddle/distributed/auto_parallel/utils.py
python/paddle/distributed/auto_parallel/utils.py
+0
-1
python/paddle/distributed/fleet/elastic/__init__.py
python/paddle/distributed/fleet/elastic/__init__.py
+2
-1
python/paddle/distributed/fleet/model.py
python/paddle/distributed/fleet/model.py
+0
-1
python/paddle/fluid/tests/custom_runtime/process_group_xccl.py
...n/paddle/fluid/tests/custom_runtime/process_group_xccl.py
+0
-1
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_dist_save_load.py
...ests/unittests/collective/fleet/dygraph_dist_save_load.py
+0
-1
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api.py
...s/unittests/collective/fleet/dygraph_group_sharded_api.py
+0
-1
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api_eager.py
...tests/collective/fleet/dygraph_group_sharded_api_eager.py
+0
-1
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2.py
...nittests/collective/fleet/dygraph_group_sharded_stage2.py
+0
-1
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2_comm_overlap.py
...ective/fleet/dygraph_group_sharded_stage2_comm_overlap.py
+0
-1
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3.py
...nittests/collective/fleet/dygraph_group_sharded_stage3.py
+0
-1
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3_offload.py
.../collective/fleet/dygraph_group_sharded_stage3_offload.py
+0
-1
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_optimizer_stage2.py
...sts/collective/fleet/dygraph_sharding_optimizer_stage2.py
+0
-1
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage2.py
...sts/unittests/collective/fleet/dygraph_sharding_stage2.py
+0
-1
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3.py
...sts/unittests/collective/fleet/dygraph_sharding_stage3.py
+0
-1
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3_offload.py
...tests/collective/fleet/dygraph_sharding_stage3_offload.py
+0
-1
python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_control_flow_same.py
...ts/collective/fleet/parallel_dygraph_control_flow_same.py
+0
-1
python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync.py
...ts/unittests/collective/fleet/parallel_dygraph_no_sync.py
+0
-1
python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_control_flow.py
...collective/fleet/parallel_dygraph_no_sync_control_flow.py
+0
-1
python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_se_resnext.py
...unittests/collective/fleet/parallel_dygraph_se_resnext.py
+0
-1
python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_group_sharded_stage3.py
...s/collective/multinode/mn_dygraph_group_sharded_stage3.py
+0
-1
python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_sharding_stage2.py
...ttests/collective/multinode/mn_dygraph_sharding_stage2.py
+0
-1
python/paddle/fluid/tests/unittests/collective/process_group_gloo.py
...le/fluid/tests/unittests/collective/process_group_gloo.py
+0
-1
python/paddle/fluid/tests/unittests/collective/process_group_mpi.py
...dle/fluid/tests/unittests/collective/process_group_mpi.py
+0
-1
python/paddle/fluid/tests/unittests/dist_word2vec.py
python/paddle/fluid/tests/unittests/dist_word2vec.py
+0
-2
python/paddle/fluid/tests/unittests/dygraph_to_static/test_mobile_net.py
...luid/tests/unittests/dygraph_to_static/test_mobile_net.py
+1
-1
python/paddle/fluid/tests/unittests/dygraph_to_static/test_sentiment.py
...fluid/tests/unittests/dygraph_to_static/test_sentiment.py
+1
-1
python/paddle/fluid/tests/unittests/ipu/test_pad_op_ipu.py
python/paddle/fluid/tests/unittests/ipu/test_pad_op_ipu.py
+2
-2
python/paddle/fluid/tests/unittests/parallel_dygraph_shared_unused_var.py
...uid/tests/unittests/parallel_dygraph_shared_unused_var.py
+0
-1
python/paddle/fluid/tests/unittests/test_batch_norm_op.py
python/paddle/fluid/tests/unittests/test_batch_norm_op.py
+0
-2
python/paddle/fluid/tests/unittests/test_batch_norm_op_v2.py
python/paddle/fluid/tests/unittests/test_batch_norm_op_v2.py
+0
-2
python/paddle/fluid/tests/unittests/test_collective_api_base.py
.../paddle/fluid/tests/unittests/test_collective_api_base.py
+1
-4
python/paddle/fluid/tests/unittests/test_collective_base.py
python/paddle/fluid/tests/unittests/test_collective_base.py
+1
-4
python/paddle/fluid/tests/unittests/test_crop_op.py
python/paddle/fluid/tests/unittests/test_crop_op.py
+0
-2
python/paddle/fluid/tests/unittests/test_crop_tensor_op.py
python/paddle/fluid/tests/unittests/test_crop_tensor_op.py
+0
-2
python/paddle/fluid/tests/unittests/test_dist_fleet_base.py
python/paddle/fluid/tests/unittests/test_dist_fleet_base.py
+5
-7
python/paddle/fluid/tests/unittests/test_fuse_relu_depthwise_conv_pass.py
...uid/tests/unittests/test_fuse_relu_depthwise_conv_pass.py
+1
-1
python/paddle/fluid/tests/unittests/test_gru_unit_op.py
python/paddle/fluid/tests/unittests/test_gru_unit_op.py
+0
-1
python/paddle/fluid/tests/unittests/test_imperative_ocr_attention_model.py
...id/tests/unittests/test_imperative_ocr_attention_model.py
+1
-1
python/paddle/fluid/tests/unittests/test_math_op_patch.py
python/paddle/fluid/tests/unittests/test_math_op_patch.py
+2
-2
python/paddle/fluid/tests/unittests/test_norm_op.py
python/paddle/fluid/tests/unittests/test_norm_op.py
+0
-2
python/paddle/fluid/tests/unittests/test_optimizer_for_varbase.py
...addle/fluid/tests/unittests/test_optimizer_for_varbase.py
+1
-1
python/paddle/fluid/tests/unittests/test_reduce_op.py
python/paddle/fluid/tests/unittests/test_reduce_op.py
+0
-2
python/paddle/fluid/tests/unittests/test_searchsorted_op.py
python/paddle/fluid/tests/unittests/test_searchsorted_op.py
+0
-1
python/paddle/fluid/tests/unittests/test_split_and_merge_lod_tensor_op.py
...uid/tests/unittests/test_split_and_merge_lod_tensor_op.py
+0
-1
python/paddle/fluid/tests/unittests/test_sum_op.py
python/paddle/fluid/tests/unittests/test_sum_op.py
+0
-1
python/paddle/fluid/tests/unittests/test_var_base.py
python/paddle/fluid/tests/unittests/test_var_base.py
+0
-5
python/paddle/fluid/tests/unittests/xpu/test_bilinear_interp_v2_op_xpu.py
...uid/tests/unittests/xpu/test_bilinear_interp_v2_op_xpu.py
+0
-1
python/paddle/fluid/tests/unittests/xpu/test_collective_base_xpu.py
...dle/fluid/tests/unittests/xpu/test_collective_base_xpu.py
+1
-4
python/paddle/fluid/tests/unittests/xpu/test_mean_op_xpu.py
python/paddle/fluid/tests/unittests/xpu/test_mean_op_xpu.py
+0
-1
python/paddle/fluid/tests/unittests/xpu/test_roll_op_xpu.py
python/paddle/fluid/tests/unittests/xpu/test_roll_op_xpu.py
+1
-1
python/paddle/fluid/tests/unittests/xpu/test_sequence_unpad_op_xpu.py
...e/fluid/tests/unittests/xpu/test_sequence_unpad_op_xpu.py
+0
-3
python/paddle/jit/dy2static/call_transformer.py
python/paddle/jit/dy2static/call_transformer.py
+1
-1
python/paddle/nn/functional/activation.py
python/paddle/nn/functional/activation.py
+0
-1
python/paddle/nn/functional/common.py
python/paddle/nn/functional/common.py
+0
-1
python/paddle/nn/functional/loss.py
python/paddle/nn/functional/loss.py
+1
-1
python/paddle/nn/layer/__init__.py
python/paddle/nn/layer/__init__.py
+0
-1
python/paddle/tensor/math.py
python/paddle/tensor/math.py
+0
-1
python/paddle/tests/test_transforms.py
python/paddle/tests/test_transforms.py
+1
-1
python/paddle/utils/flops.py
python/paddle/utils/flops.py
+1
-1
未找到文件。
.flake8
浏览文件 @
89bd4011
...
...
@@ -17,13 +17,13 @@ exclude =
ignore =
# E, see https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
E203,
E40
1,E40
2,
E402,
E501,
E721,E722,E731,E741,
# F, see https://flake8.pycqa.org/en/latest/user/error-codes.html
F405,
F8
11,F8
41,
F841,
# W, see https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
W503
...
...
@@ -37,3 +37,9 @@ per-file-ignores =
.cmake-format.py: F821
python/paddle/fluid/tests/unittests/dygraph_to_static/test_loop.py: F821
python/paddle/fluid/tests/unittests/dygraph_to_static/test_closure_analysis.py: F821
# These files will be fixed in the future
python/paddle/fluid/tests/unittests/fft/test_fft_with_static_graph.py: F811
python/paddle/fluid/tests/unittests/test_activation_nn_grad.py: F811
python/paddle/fluid/tests/unittests/test_lstm_cudnn_op.py: F811
python/paddle/fluid/tests/unittests/test_matmul_v2_op.py: F811
python/paddle/fluid/tests/unittests/test_rrelu_op.py: F811
python/paddle/autograd/__init__.py
浏览文件 @
89bd4011
...
...
@@ -25,8 +25,6 @@ if _in_eager_mode_:
else
:
from
.py_layer
import
LegacyPyLayer
as
PyLayer
# noqa: F401
from
.py_layer
import
LegacyPyLayerContext
as
PyLayerContext
# noqa: F401
from
..framework
import
set_grad_enabled
,
is_grad_enabled
# noqa: F401
from
..fluid.dygraph.base
import
no_grad_
as
no_grad
# noqa: F401
from
.saved_tensors_hooks
import
saved_tensors_hooks
__all__
=
[
# noqa
...
...
python/paddle/distributed/auto_parallel/utils.py
浏览文件 @
89bd4011
...
...
@@ -35,7 +35,6 @@ from paddle.fluid.framework import Variable
from
paddle.fluid.io
import
is_belong_to_optimizer
,
is_parameter
OP_ROLE_KEY
=
core
.
op_proto_and_checker_maker
.
kOpRoleAttrName
()
OpRole
=
core
.
op_proto_and_checker_maker
.
OpRole
__no_shape_var_type__
=
[
core
.
VarDesc
.
VarType
.
READER
,
...
...
python/paddle/distributed/fleet/elastic/__init__.py
浏览文件 @
89bd4011
...
...
@@ -13,7 +13,8 @@
# limitations under the License.
import
signal
import
os
,
sys
import
os
import
sys
from
.manager
import
ElasticManager
from
.manager
import
ElasticStatus
...
...
python/paddle/distributed/fleet/model.py
浏览文件 @
89bd4011
...
...
@@ -14,7 +14,6 @@
import
paddle
from
paddle.distributed
import
fleet
from
paddle.fluid.dygraph.varbase_patch_methods
import
_grad_scalar
from
.base.topology
import
ParallelMode
from
.meta_parallel
import
(
...
...
python/paddle/fluid/tests/custom_runtime/process_group_xccl.py
浏览文件 @
89bd4011
...
...
@@ -18,7 +18,6 @@ import unittest
import
numpy
as
np
import
paddle
import
paddle.fluid.core
as
core
from
paddle.fluid
import
core
from
paddle.fluid.dygraph.parallel
import
ParallelEnv
from
paddle.fluid.framework
import
_test_eager_guard
...
...
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_dist_save_load.py
浏览文件 @
89bd4011
...
...
@@ -31,7 +31,6 @@ from paddle.distributed.fleet.meta_parallel.sharding.group_sharded_optimizer_sta
from
paddle.distributed.fleet.meta_parallel.sharding.group_sharded_stage2
import
(
GroupShardedStage2
,
)
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.incubate.distributed.utils.io
import
load
,
save
from
paddle.nn
import
Linear
...
...
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api.py
浏览文件 @
89bd4011
...
...
@@ -24,7 +24,6 @@ from paddle.distributed.sharding import (
group_sharded_parallel
,
save_group_sharded_model
,
)
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.fluid.framework
import
_test_eager_guard
from
paddle.nn
import
Linear
...
...
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api_eager.py
浏览文件 @
89bd4011
...
...
@@ -22,7 +22,6 @@ from paddle.distributed.sharding import (
group_sharded_parallel
,
save_group_sharded_model
,
)
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.fluid.framework
import
_test_eager_guard
from
paddle.nn
import
Linear
...
...
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2.py
浏览文件 @
89bd4011
...
...
@@ -28,7 +28,6 @@ from paddle.distributed.fleet.meta_parallel.sharding.group_sharded_optimizer_sta
from
paddle.distributed.fleet.meta_parallel.sharding.group_sharded_stage2
import
(
GroupShardedStage2
,
)
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.fluid.framework
import
_test_eager_guard
from
paddle.nn
import
Linear
...
...
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2_comm_overlap.py
浏览文件 @
89bd4011
...
...
@@ -28,7 +28,6 @@ from paddle.distributed.fleet.meta_parallel.sharding.group_sharded_optimizer_sta
from
paddle.distributed.fleet.meta_parallel.sharding.group_sharded_stage2
import
(
GroupShardedStage2
,
)
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.fluid.framework
import
_test_eager_guard
from
paddle.nn
import
Linear
...
...
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3.py
浏览文件 @
89bd4011
...
...
@@ -34,7 +34,6 @@ from paddle.distributed.fleet.meta_parallel.sharding.group_sharded_stage3 import
from
paddle.distributed.fleet.meta_parallel.sharding.group_sharded_utils
import
(
GroupShardedScaler
,
)
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.fluid.framework
import
_test_eager_guard
from
paddle.nn
import
Linear
...
...
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3_offload.py
浏览文件 @
89bd4011
...
...
@@ -24,7 +24,6 @@ from paddle.distributed.fleet.meta_parallel.sharding.group_sharded_stage3 import
from
paddle.distributed.fleet.meta_parallel.sharding.group_sharded_utils
import
(
GroupShardedScaler
,
)
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.fluid.framework
import
_test_eager_guard
from
paddle.nn
import
Linear
...
...
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_optimizer_stage2.py
浏览文件 @
89bd4011
...
...
@@ -23,7 +23,6 @@ from paddle.distributed.fleet.meta_optimizers.dygraph_optimizer.sharding_optimiz
ShardingOptimizerStage2
,
)
from
paddle.distributed.fleet.utils.internal_storage
import
GradStorage
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.fluid.framework
import
_test_eager_guard
from
paddle.nn
import
Linear
...
...
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage2.py
浏览文件 @
89bd4011
...
...
@@ -29,7 +29,6 @@ from paddle.distributed.fleet.meta_optimizers.dygraph_optimizer.sharding_optimiz
from
paddle.distributed.fleet.meta_parallel.sharding.sharding_stage2
import
(
ShardingStage2
,
)
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.fluid.framework
import
_test_eager_guard
from
paddle.nn
import
Linear
...
...
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3.py
浏览文件 @
89bd4011
...
...
@@ -35,7 +35,6 @@ from paddle.distributed.fleet.meta_parallel.sharding.sharding_stage3 import (
from
paddle.distributed.fleet.meta_parallel.sharding.sharding_utils
import
(
ShardingScaler
,
)
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.fluid.framework
import
_test_eager_guard
from
paddle.nn
import
Linear
...
...
python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3_offload.py
浏览文件 @
89bd4011
...
...
@@ -25,7 +25,6 @@ from paddle.distributed.fleet.meta_parallel.sharding.sharding_stage3 import (
from
paddle.distributed.fleet.meta_parallel.sharding.sharding_utils
import
(
ShardingScaler
,
)
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.fluid.framework
import
_test_eager_guard
from
paddle.nn
import
Linear
...
...
python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_control_flow_same.py
浏览文件 @
89bd4011
...
...
@@ -18,7 +18,6 @@ from test_dist_base import TestParallelDyGraphRunnerBase, runtime_main
import
paddle
import
paddle.fluid
as
fluid
from
paddle.fluid.dygraph.base
import
to_variable
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.nn
import
Linear
np
.
random
.
seed
(
2021
)
...
...
python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync.py
浏览文件 @
89bd4011
...
...
@@ -26,7 +26,6 @@ from test_dist_base import (
import
paddle
import
paddle.distributed
as
dist
import
paddle.fluid
as
fluid
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.nn
import
Linear
seed
=
90
...
...
python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_control_flow.py
浏览文件 @
89bd4011
...
...
@@ -18,7 +18,6 @@ from test_dist_base import runtime_main
import
paddle
import
paddle.fluid
as
fluid
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.nn
import
Linear
seed
=
90
...
...
python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_se_resnext.py
浏览文件 @
89bd4011
...
...
@@ -20,7 +20,6 @@ from test_dist_base import TestParallelDyGraphRunnerBase, runtime_main
import
paddle
import
paddle.fluid
as
fluid
from
paddle.fluid.dygraph.base
import
to_variable
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.nn
import
Linear
batch_size
=
64
...
...
python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_group_sharded_stage3.py
浏览文件 @
89bd4011
...
...
@@ -34,7 +34,6 @@ from paddle.distributed.fleet.meta_parallel.sharding.group_sharded_stage3 import
from
paddle.distributed.fleet.meta_parallel.sharding.group_sharded_utils
import
(
GroupShardedScaler
,
)
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.fluid.framework
import
_test_eager_guard
from
paddle.nn
import
Linear
...
...
python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_sharding_stage2.py
浏览文件 @
89bd4011
...
...
@@ -29,7 +29,6 @@ from paddle.distributed.fleet.meta_optimizers.dygraph_optimizer.sharding_optimiz
from
paddle.distributed.fleet.meta_parallel.sharding.sharding_stage2
import
(
ShardingStage2
,
)
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.fluid.framework
import
_test_eager_guard
from
paddle.nn
import
Linear
...
...
python/paddle/fluid/tests/unittests/collective/process_group_gloo.py
浏览文件 @
89bd4011
...
...
@@ -18,7 +18,6 @@ import unittest
import
numpy
as
np
import
paddle
import
paddle.fluid.core
as
core
from
paddle.fluid
import
core
from
paddle.fluid.dygraph.parallel
import
ParallelEnv
from
paddle.fluid.framework
import
_test_eager_guard
...
...
python/paddle/fluid/tests/unittests/collective/process_group_mpi.py
浏览文件 @
89bd4011
...
...
@@ -20,7 +20,6 @@ import numpy as np
import
paddle
import
paddle.distributed
as
dist
import
paddle.fluid.core
as
core
from
paddle.distributed.collective
import
(
Group
,
_default_group_name
,
...
...
python/paddle/fluid/tests/unittests/dist_word2vec.py
浏览文件 @
89bd4011
...
...
@@ -138,8 +138,6 @@ class TestDistWord2vec2x2(TestDistRunnerBase):
if
__name__
==
"__main__"
:
import
os
os
.
environ
[
'CPU_NUM'
]
=
'1'
os
.
environ
[
'USE_CUDA'
]
=
"FALSE"
runtime_main
(
TestDistWord2vec2x2
)
python/paddle/fluid/tests/unittests/dygraph_to_static/test_mobile_net.py
浏览文件 @
89bd4011
...
...
@@ -23,7 +23,7 @@ from predictor_utils import PredictorTools
import
paddle
import
paddle.fluid
as
fluid
from
paddle.fluid.dygraph.io
import
INFER_MODEL_SUFFIX
,
INFER_PARAMS_SUFFIX
from
paddle.fluid.dygraph.nn
import
BatchNorm
,
Linear
from
paddle.fluid.dygraph.nn
import
BatchNorm
from
paddle.fluid.initializer
import
MSRA
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.jit
import
ProgramTranslator
...
...
python/paddle/fluid/tests/unittests/dygraph_to_static/test_sentiment.py
浏览文件 @
89bd4011
...
...
@@ -20,7 +20,7 @@ from test_lac import DynamicGRU
import
paddle
import
paddle.fluid
as
fluid
from
paddle.fluid.dygraph
import
to_variable
from
paddle.fluid.dygraph.nn
import
Embedding
,
Linear
from
paddle.fluid.dygraph.nn
import
Embedding
from
paddle.jit
import
ProgramTranslator
from
paddle.jit.api
import
declarative
from
paddle.nn
import
Linear
...
...
python/paddle/fluid/tests/unittests/ipu/test_pad_op_ipu.py
浏览文件 @
89bd4011
...
...
@@ -126,13 +126,13 @@ class TestCase7(TestBase):
@
unittest
.
skip
(
"Only support NCL, NCHW, NCDHW"
)
class
TestCase
7
(
TestBase
):
class
TestCase
8
(
TestBase
):
def
set_op_attrs
(
self
):
self
.
attrs
=
{
"pad"
:
[
1
,
2
,
3
,
4
],
"data_format"
:
"NHWC"
}
@
unittest
.
skip
(
"Only support NCL, NCHW, NCDHW"
)
class
TestCase
7
(
TestBase
):
class
TestCase
9
(
TestBase
):
def
set_op_attrs
(
self
):
self
.
attrs
=
{
"pad"
:
[
1
,
2
,
3
,
4
,
1
,
3
],
"data_format"
:
"NDHWC"
}
...
...
python/paddle/fluid/tests/unittests/parallel_dygraph_shared_unused_var.py
浏览文件 @
89bd4011
...
...
@@ -18,7 +18,6 @@ from test_dist_base import TestParallelDyGraphRunnerBase, runtime_main
import
paddle
import
paddle.fluid
as
fluid
from
paddle.fluid.dygraph.base
import
to_variable
from
paddle.fluid.dygraph.nn
import
Linear
from
paddle.nn
import
Linear
np
.
random
.
seed
(
2021
)
...
...
python/paddle/fluid/tests/unittests/test_batch_norm_op.py
浏览文件 @
89bd4011
...
...
@@ -847,7 +847,5 @@ class TestDygraphBatchNormOpenReserveSpace(unittest.TestCase):
if
__name__
==
'__main__'
:
import
paddle
paddle
.
enable_static
()
unittest
.
main
()
python/paddle/fluid/tests/unittests/test_batch_norm_op_v2.py
浏览文件 @
89bd4011
...
...
@@ -422,7 +422,5 @@ class TestBatchNormUseGlobalStatsCase3(TestBatchNormUseGlobalStats):
if
__name__
==
'__main__'
:
import
paddle
paddle
.
enable_static
()
unittest
.
main
()
python/paddle/fluid/tests/unittests/test_collective_api_base.py
浏览文件 @
89bd4011
...
...
@@ -14,6 +14,7 @@
import
os
import
pickle
import
socket
import
subprocess
import
sys
import
tempfile
...
...
@@ -161,10 +162,6 @@ def runtime_main(test_class, col_type):
model
.
run_trainer
(
args
)
import
socket
from
contextlib
import
closing
class
TestDistBase
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
_port_set
=
set
()
...
...
python/paddle/fluid/tests/unittests/test_collective_base.py
浏览文件 @
89bd4011
...
...
@@ -14,6 +14,7 @@
import
os
import
pickle
import
socket
import
subprocess
import
sys
import
tempfile
...
...
@@ -140,10 +141,6 @@ def runtime_main(test_class, col_type, sub_type):
model
.
run_trainer
(
args
)
import
socket
from
contextlib
import
closing
class
TestDistBase
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
_port_set
=
set
()
...
...
python/paddle/fluid/tests/unittests/test_crop_op.py
浏览文件 @
89bd4011
...
...
@@ -150,7 +150,5 @@ class TestCropNoneShape(unittest.TestCase):
if
__name__
==
'__main__'
:
import
paddle
paddle
.
enable_static
()
unittest
.
main
()
python/paddle/fluid/tests/unittests/test_crop_tensor_op.py
浏览文件 @
89bd4011
...
...
@@ -271,7 +271,5 @@ class TestCropTensorException(unittest.TestCase):
if
__name__
==
'__main__'
:
import
paddle
paddle
.
enable_static
()
unittest
.
main
()
python/paddle/fluid/tests/unittests/test_dist_fleet_base.py
浏览文件 @
89bd4011
...
...
@@ -12,14 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
paddle
import
paddle.distributed.fleet
as
fleet
import
paddle.distributed.fleet.base.role_maker
as
role_maker
import
paddle.fluid
as
fluid
from
paddle.distributed.fleet.utils.ps_util
import
DistributedInfer
"""
high level unit test for distribute fleet.
high level unit test for distribute fleet.
"""
import
argparse
...
...
@@ -34,6 +28,10 @@ import unittest
from
contextlib
import
closing
import
paddle
import
paddle.distributed.fleet
as
fleet
import
paddle.distributed.fleet.base.role_maker
as
role_maker
import
paddle.fluid
as
fluid
from
paddle.distributed.fleet.utils.ps_util
import
DistributedInfer
paddle
.
enable_static
()
...
...
python/paddle/fluid/tests/unittests/test_fuse_relu_depthwise_conv_pass.py
浏览文件 @
89bd4011
...
...
@@ -89,7 +89,7 @@ class TestMNIST(TestParallelExecutorBase):
return
optimizer
if
only_forward
:
_optimizer
=
None
_optimizer
=
None
# noqa: F811
(
fuse_op_first_loss
,
...
...
python/paddle/fluid/tests/unittests/test_gru_unit_op.py
浏览文件 @
89bd4011
...
...
@@ -19,7 +19,6 @@ import numpy as np
from
op_test
import
OpTest
import
paddle.fluid
as
fluid
from
paddle
import
fluid
from
paddle.fluid.framework
import
Program
,
program_guard
from
paddle.fluid.layers
import
gru_unit
...
...
python/paddle/fluid/tests/unittests/test_imperative_ocr_attention_model.py
浏览文件 @
89bd4011
...
...
@@ -21,7 +21,7 @@ import paddle
import
paddle.fluid
as
fluid
from
paddle.fluid
import
core
from
paddle.fluid.dygraph.base
import
to_variable
from
paddle.fluid.dygraph.nn
import
BatchNorm
,
Embedding
,
GRUUnit
,
Linear
from
paddle.fluid.dygraph.nn
import
BatchNorm
,
Embedding
,
GRUUnit
from
paddle.fluid.framework
import
_test_eager_guard
from
paddle.nn
import
Linear
...
...
python/paddle/fluid/tests/unittests/test_math_op_patch.py
浏览文件 @
89bd4011
...
...
@@ -53,7 +53,7 @@ class TestMathOpPatches(unittest.TestCase):
place
=
fluid
.
CPUPlace
()
exe
=
fluid
.
Executor
(
place
)
a_np
=
np
.
random
.
random
(
size
=
[
10
,
1
]).
astype
(
'float32'
)
b_np
=
exe
.
run
(
(
b_np
,)
=
exe
.
run
(
fluid
.
default_main_program
(),
feed
=
{
"a"
:
a_np
},
fetch_list
=
[
b
]
)
np
.
testing
.
assert_allclose
(
a_np
+
10
,
b_np
,
rtol
=
1e-05
)
...
...
@@ -71,7 +71,7 @@ class TestMathOpPatches(unittest.TestCase):
np
.
testing
.
assert_allclose
(
a_np
-
10
,
b_np
,
rtol
=
1e-05
)
@
prog_scope
()
def
test_r
add
_scalar
(
self
):
def
test_r
sub
_scalar
(
self
):
a
=
fluid
.
layers
.
data
(
name
=
"a"
,
shape
=
[
1
])
b
=
10
-
a
place
=
fluid
.
CPUPlace
()
...
...
python/paddle/fluid/tests/unittests/test_norm_op.py
浏览文件 @
89bd4011
...
...
@@ -161,7 +161,5 @@ class API_NormTest(unittest.TestCase):
if
__name__
==
'__main__'
:
import
paddle
paddle
.
enable_static
()
unittest
.
main
()
python/paddle/fluid/tests/unittests/test_optimizer_for_varbase.py
浏览文件 @
89bd4011
...
...
@@ -184,7 +184,7 @@ class TestOptimizerForVarBase(unittest.TestCase):
z
.
backward
()
opt
.
step
()
def
func_
test_create_param_lr_with_no_1_value_for_coverage
(
self
):
def
test_create_param_lr_with_no_1_value_for_coverage
(
self
):
with
_test_eager_guard
():
self
.
func_test_create_param_lr_with_1_for_coverage
()
self
.
func_test_create_param_lr_with_1_for_coverage
()
...
...
python/paddle/fluid/tests/unittests/test_reduce_op.py
浏览文件 @
89bd4011
...
...
@@ -1114,7 +1114,5 @@ class TestAnyAPI(unittest.TestCase):
if
__name__
==
'__main__'
:
import
paddle
paddle
.
enable_static
()
unittest
.
main
()
python/paddle/fluid/tests/unittests/test_searchsorted_op.py
浏览文件 @
89bd4011
...
...
@@ -21,7 +21,6 @@ import paddle
import
paddle.fluid.core
as
core
paddle
.
enable_static
()
from
op_test
import
OpTest
class
TestSearchSorted
(
OpTest
):
...
...
python/paddle/fluid/tests/unittests/test_split_and_merge_lod_tensor_op.py
浏览文件 @
89bd4011
...
...
@@ -22,7 +22,6 @@ import paddle.fluid.layers as layers
from
paddle.fluid
import
Program
,
program_guard
from
paddle.fluid.backward
import
append_backward
from
paddle.fluid.executor
import
Executor
from
paddle.fluid.framework
import
Program
,
program_guard
from
paddle.fluid.layer_helper
import
LayerHelper
from
paddle.fluid.layers.control_flow
import
merge_lod_tensor
,
split_lod_tensor
...
...
python/paddle/fluid/tests/unittests/test_sum_op.py
浏览文件 @
89bd4011
...
...
@@ -19,7 +19,6 @@ import unittest
import
gradient_checker
import
numpy
as
np
from
decorator_helper
import
prog_scope
from
op_test
import
OpTest
import
paddle
import
paddle.fluid
as
fluid
...
...
python/paddle/fluid/tests/unittests/test_var_base.py
浏览文件 @
89bd4011
...
...
@@ -1380,11 +1380,6 @@ class TestVarBase(unittest.TestCase):
self
.
func_tensor_str_bf16
()
self
.
func_tensor_str_bf16
()
def
test_tensor_str_bf16
(
self
):
with
_test_eager_guard
():
self
.
func_tensor_str_bf16
()
self
.
func_tensor_str_bf16
()
def
func_test_print_tensor_dtype
(
self
):
paddle
.
disable_static
(
paddle
.
CPUPlace
())
a
=
paddle
.
rand
([
1
])
...
...
python/paddle/fluid/tests/unittests/xpu/test_bilinear_interp_v2_op_xpu.py
浏览文件 @
89bd4011
...
...
@@ -18,7 +18,6 @@ import unittest
import
numpy
as
np
sys
.
path
.
append
(
".."
)
import
unittest
from
op_test_xpu
import
XPUOpTest
from
xpu.get_test_cover_info
import
(
...
...
python/paddle/fluid/tests/unittests/xpu/test_collective_base_xpu.py
浏览文件 @
89bd4011
...
...
@@ -14,6 +14,7 @@
import
os
import
pickle
import
socket
import
subprocess
import
sys
import
tempfile
...
...
@@ -165,10 +166,6 @@ def runtime_main(test_class, col_type, sub_type):
model
.
run_trainer
(
args
)
import
socket
from
contextlib
import
closing
class
TestDistBase
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
_port_set
=
set
()
...
...
python/paddle/fluid/tests/unittests/xpu/test_mean_op_xpu.py
浏览文件 @
89bd4011
...
...
@@ -26,7 +26,6 @@ from paddle.fluid import Program, program_guard
np
.
random
.
seed
(
10
)
from
op_test_xpu
import
XPUOpTest
from
xpu.get_test_cover_info
import
(
XPUOpTestWrapper
,
create_test_class
,
...
...
python/paddle/fluid/tests/unittests/xpu/test_roll_op_xpu.py
浏览文件 @
89bd4011
...
...
@@ -79,7 +79,7 @@ class XPUTestRollOp(XPUOpTestWrapper):
self
.
shifts
=
[
8
,
-
1
]
self
.
axis
=
[
-
1
,
-
2
]
class
TestRollOpCase
4
(
TestXPURollOp
):
class
TestRollOpCase
5
(
TestXPURollOp
):
def
init_shapes
(
self
):
self
.
x_shape
=
(
100
,
10
,
5
,
10
)
self
.
shifts
=
[
20
,
-
1
]
...
...
python/paddle/fluid/tests/unittests/xpu/test_sequence_unpad_op_xpu.py
浏览文件 @
89bd4011
...
...
@@ -19,9 +19,6 @@ import numpy as np
sys
.
path
.
append
(
".."
)
import
unittest
import
numpy
as
np
from
op_test_xpu
import
XPUOpTest
from
xpu.get_test_cover_info
import
(
XPUOpTestWrapper
,
...
...
python/paddle/jit/dy2static/call_transformer.py
浏览文件 @
89bd4011
...
...
@@ -62,7 +62,7 @@ class CallTransformer(BaseTransformer):
'enumerate'
,
'print'
,
}
is_builtin
=
eval
(
"is_builtin({})"
.
format
(
func_str
))
is_builtin
=
eval
(
"is_builtin({})"
.
format
(
func_str
))
# noqa: F811
need_convert
=
func_str
in
need_convert_builtin_func_list
return
is_builtin
and
not
need_convert
except
Exception
:
...
...
python/paddle/nn/functional/activation.py
浏览文件 @
89bd4011
...
...
@@ -14,7 +14,6 @@
import
paddle
from
paddle
import
_C_ops
,
_legacy_C_ops
,
in_dynamic_mode
from
paddle.fluid.framework
import
_in_legacy_dygraph
,
in_dygraph_mode
from
paddle.framework
import
core
from
...fluid.data_feeder
import
check_dtype
,
check_variable_and_dtype
...
...
python/paddle/nn/functional/common.py
浏览文件 @
89bd4011
...
...
@@ -14,7 +14,6 @@
import
paddle
from
paddle
import
_C_ops
,
_legacy_C_ops
from
paddle.fluid.framework
import
_in_legacy_dygraph
from
paddle.fluid.layer_helper
import
LayerHelper
from
paddle.fluid.layers.tensor
import
fill_constant
from
paddle.framework
import
core
,
in_dynamic_mode
...
...
python/paddle/nn/functional/loss.py
浏览文件 @
89bd4011
...
...
@@ -17,7 +17,7 @@
import
paddle
import
paddle.fluid
as
fluid
from
paddle
import
_C_ops
,
_legacy_C_ops
,
in_dynamic_mode
from
paddle.framework
import
_non_static_mode
,
core
from
paddle.framework
import
core
from
paddle.utils
import
deprecated
from
...fluid.data_feeder
import
check_variable_and_dtype
...
...
python/paddle/nn/layer/__init__.py
浏览文件 @
89bd4011
...
...
@@ -43,7 +43,6 @@ from .common import Dropout # noqa: F401
from
.common
import
Dropout2D
# noqa: F401
from
.common
import
Dropout3D
# noqa: F401
from
.common
import
AlphaDropout
# noqa: F401
from
.common
import
Upsample
# noqa: F401
from
.common
import
UpsamplingBilinear2D
# noqa: F401
from
.common
import
UpsamplingNearest2D
# noqa: F401
from
.common
import
Fold
...
...
python/paddle/tensor/math.py
浏览文件 @
89bd4011
...
...
@@ -30,7 +30,6 @@ from ..fluid.data_feeder import (
convert_dtype
,
)
from
..fluid.dygraph.inplace_utils
import
inplace_apis_in_dygraph_only
from
..fluid.framework
import
_in_legacy_dygraph
from
..fluid.layers
import
elementwise_sub
,
utils
from
..framework
import
(
LayerHelper
,
...
...
python/paddle/tests/test_transforms.py
浏览文件 @
89bd4011
...
...
@@ -652,7 +652,7 @@ class TestTransformsTensor(TestTransformsCV2):
transform
=
transforms
.
RandomResizedCrop
(
64
)
transform
(
1
)
test_color_jitter
=
None
test_color_jitter
=
None
# noqa: F811
class
TestFunctional
(
unittest
.
TestCase
):
...
...
python/paddle/utils/flops.py
浏览文件 @
89bd4011
...
...
@@ -117,7 +117,7 @@ def _elementwise_mul_flops(input_shapes, attrs):
@
register_flops
(
"elementwise_div"
)
def
_elementwise_
mul
_flops
(
input_shapes
,
attrs
):
def
_elementwise_
div
_flops
(
input_shapes
,
attrs
):
"""FLOPs computation for elementwise_div op.
For elementwise_div(input,other):
input_shapes = [shape_of_input, shape_of_ohther]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录