Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
5f25183e
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看板
未验证
提交
5f25183e
编写于
10月 12, 2022
作者:
S
Shuangchi He
提交者:
GitHub
10月 12, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CodeStyle][F401] remove unused imports in unittests/r_cmake_paddle_tools. (#46712)
上级
4bbb0b38
变更
56
隐藏空白更改
内联
并排
Showing
56 changed file
with
50 addition
and
180 deletion
+50
-180
cmake/make_resource.py
cmake/make_resource.py
+4
-3
paddle/fluid/eager/auto_code_generator/generator/codegen_utils.py
...luid/eager/auto_code_generator/generator/codegen_utils.py
+0
-3
paddle/fluid/eager/auto_code_generator/generator/eager_gen.py
...le/fluid/eager/auto_code_generator/generator/eager_gen.py
+5
-9
paddle/fluid/eager/auto_code_generator/generator/python_c_gen.py
...fluid/eager/auto_code_generator/generator/python_c_gen.py
+2
-4
paddle/fluid/inference/api/demo_ci/untar_model.py
paddle/fluid/inference/api/demo_ci/untar_model.py
+1
-1
paddle/fluid/inference/tests/api/full_ILSVRC2012_val_preprocess.py
...uid/inference/tests/api/full_ILSVRC2012_val_preprocess.py
+27
-31
paddle/fluid/inference/tests/api/test_detection_dataset_preprocess.py
.../inference/tests/api/test_detection_dataset_preprocess.py
+0
-4
paddle/infrt/tests/models/abs_model.py
paddle/infrt/tests/models/abs_model.py
+0
-1
paddle/infrt/tests/models/efficientnet-b4/net/utils.py
paddle/infrt/tests/models/efficientnet-b4/net/utils.py
+0
-1
paddle/phi/api/yaml/generator/api_gen.py
paddle/phi/api/yaml/generator/api_gen.py
+0
-1
paddle/phi/api/yaml/generator/backward_api_gen.py
paddle/phi/api/yaml/generator/backward_api_gen.py
+0
-1
paddle/phi/api/yaml/generator/filters.py
paddle/phi/api/yaml/generator/filters.py
+1
-4
paddle/phi/api/yaml/generator/generate_op.py
paddle/phi/api/yaml/generator/generate_op.py
+0
-2
paddle/phi/api/yaml/generator/intermediate_api_gen.py
paddle/phi/api/yaml/generator/intermediate_api_gen.py
+0
-2
paddle/phi/api/yaml/generator/ops_extra_info_gen.py
paddle/phi/api/yaml/generator/ops_extra_info_gen.py
+0
-1
paddle/phi/api/yaml/generator/parse_api.py
paddle/phi/api/yaml/generator/parse_api.py
+0
-1
paddle/phi/api/yaml/generator/parse_utils.py
paddle/phi/api/yaml/generator/parse_utils.py
+0
-1
paddle/phi/api/yaml/generator/sparse_api_gen.py
paddle/phi/api/yaml/generator/sparse_api_gen.py
+0
-2
paddle/phi/api/yaml/generator/sparse_bw_api_gen.py
paddle/phi/api/yaml/generator/sparse_bw_api_gen.py
+0
-2
paddle/phi/api/yaml/generator/strings_api_gen.py
paddle/phi/api/yaml/generator/strings_api_gen.py
+0
-2
paddle/phi/api/yaml/generator/wrapped_infermeta_gen.py
paddle/phi/api/yaml/generator/wrapped_infermeta_gen.py
+0
-1
paddle/scripts/conda_build.py
paddle/scripts/conda_build.py
+0
-2
r/example/mobilenet.py
r/example/mobilenet.py
+0
-2
tools/CrossStackProfiler/CspChromeTraceFormatter.py
tools/CrossStackProfiler/CspChromeTraceFormatter.py
+0
-11
tools/CrossStackProfiler/CspFileReader.py
tools/CrossStackProfiler/CspFileReader.py
+1
-2
tools/CrossStackProfiler/CspReporter.py
tools/CrossStackProfiler/CspReporter.py
+1
-6
tools/CrossStackProfiler/DCGMFileReader.py
tools/CrossStackProfiler/DCGMFileReader.py
+2
-8
tools/CrossStackProfiler/NetFileReader.py
tools/CrossStackProfiler/NetFileReader.py
+2
-9
tools/CrossStackProfiler/ProfileFileReader.py
tools/CrossStackProfiler/ProfileFileReader.py
+1
-8
tools/analysisPyXml.py
tools/analysisPyXml.py
+0
-4
tools/check_api_source_without_core_ops.py
tools/check_api_source_without_core_ops.py
+0
-2
tools/check_ut.py
tools/check_ut.py
+0
-1
tools/codestyle/docstring_checker.py
tools/codestyle/docstring_checker.py
+1
-2
tools/codestyle/test_docstring_checker.py
tools/codestyle/test_docstring_checker.py
+0
-2
tools/count_api_without_core_ops.py
tools/count_api_without_core_ops.py
+0
-4
tools/diff_unittest.py
tools/diff_unittest.py
+0
-1
tools/externalError/spider.py
tools/externalError/spider.py
+0
-2
tools/final_ut_parallel_rule.py
tools/final_ut_parallel_rule.py
+0
-3
tools/get_pr_ut.py
tools/get_pr_ut.py
+0
-1
tools/get_single_test_cov.py
tools/get_single_test_cov.py
+0
-2
tools/get_ut_file_map.py
tools/get_ut_file_map.py
+0
-1
tools/handle_h_cu_file.py
tools/handle_h_cu_file.py
+0
-1
tools/infrt/fake_models/multi_fc.py
tools/infrt/fake_models/multi_fc.py
+0
-3
tools/infrt/generate_phi_kernel_dialect.py
tools/infrt/generate_phi_kernel_dialect.py
+0
-1
tools/infrt/get_compat_kernel_signature.py
tools/infrt/get_compat_kernel_signature.py
+0
-2
tools/infrt/get_phi_kernel_info.py
tools/infrt/get_phi_kernel_info.py
+1
-1
tools/infrt/print_kernel_pass_info.py
tools/infrt/print_kernel_pass_info.py
+0
-1
tools/parallel_UT_rule.py
tools/parallel_UT_rule.py
+0
-1
tools/print_signatures.py
tools/print_signatures.py
+1
-5
tools/pyCov_multithreading.py
tools/pyCov_multithreading.py
+0
-3
tools/sampcd_processor.py
tools/sampcd_processor.py
+0
-2
tools/summary_env.py
tools/summary_env.py
+0
-1
tools/test_check_api_compatible.py
tools/test_check_api_compatible.py
+0
-3
tools/test_sampcd_processor.py
tools/test_sampcd_processor.py
+0
-1
tools/timeline.py
tools/timeline.py
+0
-3
tools/windows/get_prec_ut_list.py
tools/windows/get_prec_ut_list.py
+0
-2
未找到文件。
cmake/make_resource.py
浏览文件 @
5f25183e
...
...
@@ -20,6 +20,7 @@ res = sys.argv[1]
out
=
sys
.
argv
[
2
]
var
=
re
.
sub
(
r
'[ .-]'
,
'_'
,
os
.
path
.
basename
(
res
))
open
(
out
,
"w"
).
write
(
"const unsigned char "
+
var
+
"[] = {"
+
","
.
join
([
"0x%02x"
%
ord
(
c
)
for
c
in
open
(
res
).
read
()
])
+
",0};
\n
"
+
"const unsigned "
+
var
+
"_size = sizeof("
+
var
+
");
\n
"
)
open
(
out
,
"w"
).
write
(
"const unsigned char "
+
var
+
"[] = {"
+
","
.
join
([
"0x%02x"
%
ord
(
c
)
for
c
in
open
(
res
).
read
()])
+
",0};
\n
"
+
"const unsigned "
+
var
+
"_size = sizeof("
+
var
+
");
\n
"
)
paddle/fluid/eager/auto_code_generator/generator/codegen_utils.py
浏览文件 @
5f25183e
...
...
@@ -12,11 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
logging
import
yaml
import
re
import
argparse
import
os
########################
### Global Variables ###
...
...
paddle/fluid/eager/auto_code_generator/generator/eager_gen.py
浏览文件 @
5f25183e
...
...
@@ -12,23 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
yaml
import
re
import
argparse
import
os
import
logging
from
codegen_utils
import
core_ops_returns_info
,
core_ops_args_info
,
core_ops_args_type_info
from
codegen_utils
import
yaml_types_mapping
from
codegen_utils
import
ReadFwdFile
,
ReadBwdFile
from
codegen_utils
import
FindGradName
,
FindForwardName
,
GetSavedName
,
GetGradNodeName
from
codegen_utils
import
ReadBwdFile
from
codegen_utils
import
FindForwardName
,
GetGradNodeName
,
GetSavedName
from
codegen_utils
import
IsPlainTensorType
,
IsVectorTensorType
from
codegen_utils
import
GetConstReference
,
RemoveConstAndReference
from
codegen_utils
import
GetDygraphForwardFunctionName
,
GetIntermediateAPIFunctionName
,
GetDygraphLogName
from
codegen_utils
import
GetDygraphForwardFunctionName
,
GetIntermediateAPIFunctionName
from
codegen_utils
import
GetAutoGradMetaName
,
GetAutoGradMetaVectorName
from
codegen_utils
import
RemoveSpecialSymbolsInName
,
RecoverBaseNameOfInplaceFunction
from
codegen_utils
import
GetInplacedFunctionName
from
codegen_utils
import
ParseYaml
Args
,
ParseYamlReturns
,
ParseYaml
ForwardFromBackward
from
codegen_utils
import
ParseYaml
Forward
,
ParseYaml
Backward
from
codegen_utils
import
ParseYamlForwardFromBackward
from
codegen_utils
import
ParseYamlBackward
from
codegen_utils
import
ParseYamlInplaceInfo
from
codegen_utils
import
FunctionGeneratorBase
,
GeneratorBase
from
codegen_utils
import
ops_to_fill_zero_for_empty_grads
...
...
paddle/fluid/eager/auto_code_generator/generator/python_c_gen.py
浏览文件 @
5f25183e
...
...
@@ -14,11 +14,9 @@
import
os
import
argparse
import
logging
from
codegen_utils
import
FunctionGeneratorBase
,
GeneratorBase
from
codegen_utils
import
yaml_types_mapping
from
codegen_utils
import
ReadFwdFile
,
IsVectorTensorType
,
GetForwardFunctionName
from
codegen_utils
import
ParseYamlForward
,
GetInplacedFunctionName
from
codegen_utils
import
GetForwardFunctionName
,
IsVectorTensorType
from
codegen_utils
import
GetInplacedFunctionName
###########################
## Global Configurations ##
...
...
paddle/fluid/inference/api/demo_ci/untar_model.py
浏览文件 @
5f25183e
...
...
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
tarfile
,
os
import
tarfile
import
sys
...
...
paddle/fluid/inference/tests/api/full_ILSVRC2012_val_preprocess.py
浏览文件 @
5f25183e
...
...
@@ -10,18 +10,11 @@
# without warranties or conditions of any kind, either express or implied.
# see the license for the specific language governing permissions and
# limitations under the license.
import
hashlib
import
unittest
import
os
import
io
import
numpy
as
np
import
time
import
sys
import
random
import
functools
import
contextlib
from
PIL
import
Image
import
math
from
paddle.dataset.common
import
download
import
tarfile
import
argparse
...
...
@@ -163,12 +156,12 @@ def run_convert():
retry
=
0
try_limit
=
3
while
not
(
os
.
path
.
exists
(
output_file
)
and
os
.
path
.
getsize
(
output_file
)
==
FULL_SIZE_BYTES
):
while
not
(
os
.
path
.
exists
(
output_file
)
and
os
.
path
.
getsize
(
output_file
)
==
FULL_SIZE_BYTES
):
if
os
.
path
.
exists
(
output_file
):
sys
.
stderr
.
write
(
"
\n\n
The existing binary file[{}] is broken. Start to generate new one...
\n\n
"
.
format
(
output_file
))
"
\n\n
The existing binary file[{}] is broken. Start to generate new one...
\n\n
"
.
format
(
output_file
))
os
.
remove
(
output_file
)
if
retry
<
try_limit
:
retry
=
retry
+
1
...
...
@@ -204,15 +197,16 @@ def convert_Imagenet_local2bin(args):
img
=
Image
.
open
(
img_path
)
img
=
process_image
(
img
)
np_img
=
np
.
array
(
img
)
of
.
seek
(
SIZE_INT64
+
SIZE_FLOAT32
*
DATA_DIM
*
DATA_DIM
*
3
*
idx
)
of
.
seek
(
SIZE_INT64
+
SIZE_FLOAT32
*
DATA_DIM
*
DATA_DIM
*
3
*
idx
)
of
.
write
(
np_img
.
astype
(
'float32'
).
tobytes
())
#save label(int64_t) to file
label_int
=
(
int
)(
label
)
np_label
=
np
.
array
(
label_int
)
of
.
seek
(
SIZE_INT64
+
SIZE_FLOAT32
*
DATA_DIM
*
DATA_DIM
*
3
*
num_images
+
idx
*
SIZE_INT64
)
of
.
seek
(
SIZE_INT64
+
SIZE_FLOAT32
*
DATA_DIM
*
DATA_DIM
*
3
*
num_images
+
idx
*
SIZE_INT64
)
of
.
write
(
np_label
.
astype
(
'int64'
).
tobytes
())
# The bin file should contain
...
...
@@ -221,39 +215,41 @@ def convert_Imagenet_local2bin(args):
target_size
=
SIZE_INT64
+
num_images
*
3
*
args
.
data_dim
*
args
.
data_dim
*
SIZE_FLOAT32
+
num_images
*
SIZE_INT64
if
(
os
.
path
.
getsize
(
bin_file_path
)
==
target_size
):
print
(
"Success! The user data output binary file can be found at: {0}"
.
format
(
bin_file_path
))
"Success! The user data output binary file can be found at: {0}"
.
format
(
bin_file_path
))
else
:
print
(
"Conversion failed!"
)
def
main_preprocess_Imagenet
(
args
):
parser
=
argparse
.
ArgumentParser
(
description
=
"Convert the full Imagenet val set or local data to binary file."
,
description
=
"Convert the full Imagenet val set or local data to binary file."
,
usage
=
None
,
add_help
=
True
)
parser
.
add_argument
(
'--local'
,
action
=
"store_true"
,
help
=
"If used, user need to set --data_dir and then convert file"
)
parser
.
add_argument
(
"--data_dir"
,
default
=
""
,
type
=
str
,
help
=
"Dataset root directory"
)
parser
.
add_argument
(
"--data_dir"
,
default
=
""
,
type
=
str
,
help
=
"Dataset root directory"
)
parser
.
add_argument
(
"--label_list"
,
type
=
str
,
default
=
"val_list.txt"
,
help
=
"List of object labels with same sequence as denoted in the annotation file"
help
=
"List of object labels with same sequence as denoted in the annotation file"
)
parser
.
add_argument
(
"--output_file"
,
type
=
str
,
default
=
"imagenet_small.bin"
,
help
=
"File path of the output binary file"
)
parser
.
add_argument
(
"--data_dim"
,
type
=
int
,
default
=
DATA_DIM
,
help
=
"Image preprocess with data_dim width and height"
)
parser
.
add_argument
(
"--output_file"
,
type
=
str
,
default
=
"imagenet_small.bin"
,
help
=
"File path of the output binary file"
)
parser
.
add_argument
(
"--data_dim"
,
type
=
int
,
default
=
DATA_DIM
,
help
=
"Image preprocess with data_dim width and height"
)
args
=
parser
.
parse_args
()
if
args
.
local
:
...
...
paddle/fluid/inference/tests/api/test_detection_dataset_preprocess.py
浏览文件 @
5f25183e
...
...
@@ -12,10 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
full_pascalvoc_test_preprocess
import
main_pascalvoc_preprocess
import
numpy
as
np
import
paddle.fluid.core
as
core
import
paddle.fluid
as
fluid
import
unittest
import
os
...
...
paddle/infrt/tests/models/abs_model.py
浏览文件 @
5f25183e
...
...
@@ -13,7 +13,6 @@
# limitations under the License.
import
paddle
from
paddle.nn
import
Layer
from
paddle.static
import
InputSpec
from
paddle.jit
import
to_static
import
sys
...
...
paddle/infrt/tests/models/efficientnet-b4/net/utils.py
浏览文件 @
5f25183e
...
...
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
re
import
math
from
functools
import
partial
...
...
paddle/phi/api/yaml/generator/api_gen.py
浏览文件 @
5f25183e
...
...
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
yaml
import
argparse
import
re
...
...
paddle/phi/api/yaml/generator/backward_api_gen.py
浏览文件 @
5f25183e
...
...
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
yaml
import
argparse
import
re
...
...
paddle/phi/api/yaml/generator/filters.py
浏览文件 @
5f25183e
...
...
@@ -12,17 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
typing
import
List
,
Dict
import
itertools
import
re
from
jinja2.filters
import
do_xmlattr
from
type_mapping
import
(
input_types_map
,
optional_input_types_map
,
attr_types_map
,
opmaker_attr_types_map
,
output_type_map
)
from
type_mapping
import
(
dense_input_types_map
,
dense_optional_input_types_map
,
dense_output_types_map
,
sr_input_types_map
,
sr_optional_input_types_map
,
sr_output_types_map
,
dense_output_types_map
,
sr_output_types_map
,
phi_attr_types_map
)
...
...
paddle/phi/api/yaml/generator/generate_op.py
浏览文件 @
5f25183e
...
...
@@ -14,8 +14,6 @@
import
argparse
import
os
import
re
from
itertools
import
chain
from
pathlib
import
Path
import
yaml
...
...
paddle/phi/api/yaml/generator/intermediate_api_gen.py
浏览文件 @
5f25183e
...
...
@@ -12,10 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
yaml
import
argparse
import
re
from
api_gen
import
ForwardAPI
from
sparse_api_gen
import
SparseAPI
...
...
paddle/phi/api/yaml/generator/ops_extra_info_gen.py
浏览文件 @
5f25183e
...
...
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
yaml
import
re
import
argparse
...
...
paddle/phi/api/yaml/generator/parse_api.py
浏览文件 @
5f25183e
...
...
@@ -13,7 +13,6 @@
# limitations under the License.
import
argparse
from
pathlib
import
Path
import
yaml
...
...
paddle/phi/api/yaml/generator/parse_utils.py
浏览文件 @
5f25183e
...
...
@@ -13,7 +13,6 @@
# limitations under the License.
import
re
import
yaml
from
copy
import
copy
from
typing
import
Dict
,
Any
,
List
,
Tuple
from
tests
import
is_attr
,
is_input
,
is_output
,
is_vec
...
...
paddle/phi/api/yaml/generator/sparse_api_gen.py
浏览文件 @
5f25183e
...
...
@@ -12,10 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
yaml
import
argparse
import
re
from
api_gen
import
ForwardAPI
from
api_base
import
PREFIX_TENSOR_NAME
...
...
paddle/phi/api/yaml/generator/sparse_bw_api_gen.py
浏览文件 @
5f25183e
...
...
@@ -12,10 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
yaml
import
argparse
import
re
from
sparse_api_gen
import
SparseAPI
from
backward_api_gen
import
BackwardAPI
...
...
paddle/phi/api/yaml/generator/strings_api_gen.py
浏览文件 @
5f25183e
...
...
@@ -12,10 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
yaml
import
argparse
import
re
from
api_gen
import
ForwardAPI
...
...
paddle/phi/api/yaml/generator/wrapped_infermeta_gen.py
浏览文件 @
5f25183e
...
...
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
yaml
import
argparse
...
...
paddle/scripts/conda_build.py
浏览文件 @
5f25183e
...
...
@@ -16,10 +16,8 @@
#
import
platform
from
sys
import
argv
import
argparse
import
os
import
time
def
parse_args
():
...
...
r/example/mobilenet.py
浏览文件 @
5f25183e
...
...
@@ -16,10 +16,8 @@
# pylint: skip-file
import
functools
import
numpy
as
np
from
paddle.fluid.core
import
AnalysisConfig
from
paddle.fluid.core
import
AnalysisPredictor
from
paddle.fluid.core
import
create_paddle_predictor
...
...
tools/CrossStackProfiler/CspChromeTraceFormatter.py
浏览文件 @
5f25183e
...
...
@@ -12,18 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
argparse
import
json
import
six
import
sys
import
re
import
os
import
glob
import
unittest
import
pandas
import
tempfile
import
platform
import
pandas
as
pd
class
ChromeTraceFormatter
(
object
):
...
...
tools/CrossStackProfiler/CspFileReader.py
浏览文件 @
5f25183e
...
...
@@ -17,8 +17,7 @@ import time
import
json
import
glob
import
logging
import
pandas
as
pd
from
multiprocessing
import
Process
,
Lock
from
multiprocessing
import
Lock
""" Some terms to clarify the code
in most case, one or more paremeters may be set as input args for a class or a function
in form of single variable or k-v dict
...
...
tools/CrossStackProfiler/CspReporter.py
浏览文件 @
5f25183e
...
...
@@ -14,21 +14,16 @@
import
os
import
glob
import
logging
import
argparse
import
multiprocessing
import
pandas
as
pd
from
multiprocessing
import
Process
from
NetFileReader
import
netFileReader
from
DCGMFileReader
import
dcgmFileReader
from
ProfileFileReader
import
profileFileReader
from
CspFileReader
import
getLogger
from
CspFileReader
import
TIME_PATH
,
DCGM_PATH
,
NET_PATH
,
PROFILE_PATH
from
CspFileReader
import
NETINFO_TRACE_NUM
,
DCGMINFO_TRACE_NUM
,
PIPELINEINFO_TRACE_NUM
from
CspFileReader
import
FILEORGANIZEFORM_BYRANK
,
FILEORGANIZEFORM_BYTRAINER
,
FILEORGANIZEFORM_BYOTHER
,
FILEORGANIZEFORM
from
CspFileReader
import
FILEORGANIZEFORM_BYRANK
,
FILEORGANIZEFORM_BYTRAINER
def
get_argparse
():
...
...
tools/CrossStackProfiler/DCGMFileReader.py
浏览文件 @
5f25183e
...
...
@@ -14,23 +14,17 @@
import
os
import
re
import
json
import
glob
import
logging
import
tempfile
import
argparse
import
pandas
as
pd
import
multiprocessing
from
multiprocessing
import
Process
from
CspChromeTraceFormatter
import
ChromeTraceFormatter
from
CspFileReader
import
FileReader
from
CspFileReader
import
getLogger
from
CspFileReader
import
dcgmMetricParameterMap
from
CspFileReader
import
TIME_PATH
,
DCGM_PATH
,
NET_PATH
,
PROFILE_PATH
from
CspFileReader
import
NETINFO_TRACE_NUM
,
DCGMINFO_TRACE_NUM
,
PIPELINEINFO_TRACE_NUM
from
CspFileReader
import
FILEORGANIZEFORM_BYRANK
,
FILEORGANIZEFORM_BYTRAINER
,
FILEORGANIZEFORM_BYOTHER
,
FILEORGANIZEFORM
from
CspFileReader
import
PIPELINEINFO_TRACE_NUM
from
CspFileReader
import
FILEORGANIZEFORM_BYTRAINER
class
dcgmFileReader
(
FileReader
):
...
...
tools/CrossStackProfiler/NetFileReader.py
浏览文件 @
5f25183e
...
...
@@ -12,22 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
json
import
glob
import
logging
import
pandas
as
pd
import
multiprocessing
from
multiprocessing
import
Process
from
CspChromeTraceFormatter
import
ChromeTraceFormatter
from
CspFileReader
import
FileReader
from
CspFileReader
import
getLogger
from
CspFileReader
import
TIME_PATH
,
DCGM_PATH
,
NET_PATH
,
PROFILE_PATH
from
CspFileReader
import
NETINFO_TRACE_NUM
,
DCGMINFO_TRACE_NUM
,
PIPELINEINFO_TRACE_NUM
from
CspFileReader
import
FILEORGANIZEFORM_BYRANK
,
FILEORGANIZEFORM_BYTRAINER
,
FILEORGANIZEFORM_BYOTHER
,
FILEORGANIZEFORM
from
CspFileReader
import
PIPELINEINFO_TRACE_NUM
from
CspFileReader
import
FILEORGANIZEFORM_BYTRAINER
class
netFileReader
(
FileReader
):
...
...
tools/CrossStackProfiler/ProfileFileReader.py
浏览文件 @
5f25183e
...
...
@@ -12,26 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
six
import
glob
import
json
import
logging
import
argparse
import
pandas
as
pd
import
multiprocessing
from
multiprocessing
import
Process
import
google.protobuf.text_format
as
text_format
import
paddle.fluid.proto.profiler.profiler_pb2
as
profiler_pb2
from
CspChromeTraceFormatter
import
ChromeTraceFormatter
from
CspFileReader
import
FileReader
from
CspFileReader
import
getLogger
from
CspFileReader
import
TIME_PATH
,
DCGM_PATH
,
NET_PATH
,
PROFILE_PATH
from
CspFileReader
import
NETINFO_TRACE_NUM
,
DCGMINFO_TRACE_NUM
,
PIPELINEINFO_TRACE_NUM
from
CspFileReader
import
FILEORGANIZEFORM_BYRANK
,
FILEORGANIZEFORM_BYTRAINER
,
FILEORGANIZEFORM_BYOTHER
,
FILEORGANIZEFORM
from
CspFileReader
import
FILEORGANIZEFORM_BYRANK
class
profileFileReader
(
FileReader
):
...
...
tools/analysisPyXml.py
浏览文件 @
5f25183e
...
...
@@ -15,11 +15,7 @@
import
commands
from
xml.etree
import
ElementTree
import
re
import
time
import
queue
import
threading
import
os
import
json
import
sys
...
...
tools/check_api_source_without_core_ops.py
浏览文件 @
5f25183e
...
...
@@ -14,8 +14,6 @@
import
difflib
import
sys
import
importlib
import
os
import
count_api_without_core_ops
with
open
(
sys
.
argv
[
1
],
'r'
)
as
f
:
...
...
tools/check_ut.py
浏览文件 @
5f25183e
...
...
@@ -15,7 +15,6 @@
""" Get pull requests. """
import
os
import
time
import
os.path
from
github
import
Github
...
...
tools/codestyle/docstring_checker.py
浏览文件 @
5f25183e
...
...
@@ -13,10 +13,9 @@
# limitations under the License.
"""DocstringChecker is used to check python doc string's style."""
import
six
import
astroid
from
pylint.checkers
import
BaseChecker
,
utils
from
pylint.checkers
import
BaseChecker
from
pylint.interfaces
import
IAstroidChecker
from
collections
import
defaultdict
...
...
tools/codestyle/test_docstring_checker.py
浏览文件 @
5f25183e
...
...
@@ -15,8 +15,6 @@
import
docstring_checker
import
pylint.testutils
import
astroid
import
pytest
import
sys
class
TestDocstring
(
pylint
.
testutils
.
CheckerTestCase
):
...
...
tools/count_api_without_core_ops.py
浏览文件 @
5f25183e
...
...
@@ -16,11 +16,7 @@ import importlib
import
inspect
import
collections
import
sys
import
pydoc
import
hashlib
import
functools
import
platform
from
paddle
import
_C_ops
,
_legacy_C_ops
__all__
=
[
'get_apis_with_and_without_core_ops'
,
...
...
tools/diff_unittest.py
浏览文件 @
5f25183e
...
...
@@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
difflib
import
sys
try
:
...
...
tools/externalError/spider.py
浏览文件 @
5f25183e
...
...
@@ -15,8 +15,6 @@
import
ssl
import
re
import
urllib.request
import
json
import
collections
import
sys
import
getopt
import
external_error_pb2
...
...
tools/final_ut_parallel_rule.py
浏览文件 @
5f25183e
...
...
@@ -15,10 +15,7 @@
# limitations under the License.
import
os
import
time
import
json
import
datetime
import
codecs
import
sys
...
...
tools/get_pr_ut.py
浏览文件 @
5f25183e
...
...
@@ -16,7 +16,6 @@
import
os
import
json
import
re
import
sys
import
time
import
subprocess
import
requests
...
...
tools/get_single_test_cov.py
浏览文件 @
5f25183e
...
...
@@ -13,8 +13,6 @@
# limitations under the License.
import
os
import
json
import
time
import
sys
import
re
...
...
tools/get_ut_file_map.py
浏览文件 @
5f25183e
...
...
@@ -14,7 +14,6 @@
import
os
import
sys
import
re
import
json
...
...
tools/handle_h_cu_file.py
浏览文件 @
5f25183e
...
...
@@ -15,7 +15,6 @@
import
queue
import
threading
import
os
import
json
import
time
import
sys
...
...
tools/infrt/fake_models/multi_fc.py
浏览文件 @
5f25183e
...
...
@@ -14,9 +14,6 @@
"""
A fake model with multiple FC layers to test CINN on a more complex model.
"""
import
numpy
import
sys
,
os
import
numpy
as
np
import
paddle
import
paddle.fluid
as
fluid
...
...
tools/infrt/generate_phi_kernel_dialect.py
浏览文件 @
5f25183e
...
...
@@ -14,7 +14,6 @@
import
json
import
yaml
import
sys
import
os
from
get_compat_kernel_signature
import
get_compat_kernels_info
...
...
tools/infrt/get_compat_kernel_signature.py
浏览文件 @
5f25183e
...
...
@@ -13,8 +13,6 @@
# limitations under the License.
import
os
import
re
import
json
skip_list
=
[
"adam_sig.cc"
,
"adamw_sig.cc"
]
...
...
tools/infrt/get_phi_kernel_info.py
浏览文件 @
5f25183e
...
...
@@ -17,7 +17,7 @@
import
argparse
import
json
import
yaml
from
typing
import
List
,
Dict
,
Any
from
typing
import
Dict
,
List
skipped_phi_api_list_file
=
"/tools/infrt/skipped_phi_api.json"
api_yaml_file
=
"/paddle/phi/api/yaml/api.yaml"
...
...
tools/infrt/print_kernel_pass_info.py
浏览文件 @
5f25183e
...
...
@@ -14,7 +14,6 @@
import
os
import
re
import
json
skip_list
=
[]
...
...
tools/parallel_UT_rule.py
浏览文件 @
5f25183e
...
...
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
sys
import
os
import
platform
...
...
tools/print_signatures.py
浏览文件 @
5f25183e
...
...
@@ -25,6 +25,7 @@ import hashlib
import
pkgutil
import
logging
import
argparse
import
paddle
member_dict
=
collections
.
OrderedDict
()
...
...
@@ -126,7 +127,6 @@ def get_all_api(root_path='paddle', attr="__all__"):
"""
walk through the paddle package to collect all the apis.
"""
import
paddle
global
api_info_dict
api_counter
=
0
for
filefinder
,
name
,
ispkg
in
pkgutil
.
walk_packages
(
...
...
@@ -140,7 +140,6 @@ def get_all_api(root_path='paddle', attr="__all__"):
continue
except
AttributeError
:
logger
.
warning
(
"AttributeError occurred when `eval(%s)`"
,
name
)
pass
else
:
api_counter
+=
process_module
(
m
,
attr
)
...
...
@@ -159,7 +158,6 @@ def insert_api_into_dict(full_name, gen_doc_anno=None):
Return:
api_info object or None
"""
import
paddle
try
:
obj
=
eval
(
full_name
)
fc_id
=
id
(
obj
)
...
...
@@ -222,7 +220,6 @@ def process_module(m, attr="__all__"):
def
check_public_api
():
import
paddle
modulelist
=
[
#npqa
paddle
,
paddle
.
amp
,
paddle
.
nn
,
paddle
.
nn
.
functional
,
paddle
.
nn
.
initializer
,
paddle
.
nn
.
utils
,
paddle
.
static
,
paddle
.
static
.
nn
,
...
...
@@ -271,7 +268,6 @@ def check_public_api():
def
check_allmodule_callable
():
import
paddle
modulelist
=
[
paddle
]
for
m
in
modulelist
:
visit_all_module
(
m
)
...
...
tools/pyCov_multithreading.py
浏览文件 @
5f25183e
...
...
@@ -12,13 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
xml.etree
import
ElementTree
import
re
import
time
import
queue
import
threading
import
os
import
json
import
sys
taskQueue
=
queue
.
Queue
()
...
...
tools/sampcd_processor.py
浏览文件 @
5f25183e
...
...
@@ -448,8 +448,6 @@ def get_filenames(full_test=False):
'''
global
whl_error
import
paddle
import
paddle.fluid.contrib.slim.quantization
whl_error
=
[]
if
full_test
:
get_full_api_from_pr_spec
()
...
...
tools/summary_env.py
浏览文件 @
5f25183e
...
...
@@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
sys
import
distro
import
platform
...
...
tools/test_check_api_compatible.py
浏览文件 @
5f25183e
...
...
@@ -17,10 +17,7 @@
TestCases for check_api_compatible.py
"""
import
unittest
import
sys
import
os
import
tempfile
import
inspect
from
check_api_compatible
import
read_argspec_from_file
from
check_api_compatible
import
check_compatible
...
...
tools/test_sampcd_processor.py
浏览文件 @
5f25183e
...
...
@@ -451,7 +451,6 @@ class Test_get_api_md5(unittest.TestCase):
def
tearDown
(
self
):
os
.
remove
(
self
.
api_pr_spec_filename
)
pass
def
test_get_api_md5
(
self
):
res
=
get_api_md5
(
'paddle/fluid/API_PR.spec'
)
...
...
tools/timeline.py
浏览文件 @
5f25183e
...
...
@@ -15,10 +15,7 @@
import
argparse
import
json
import
six
import
sys
import
unittest
import
google.protobuf.text_format
as
text_format
import
paddle.fluid.proto.profiler.profiler_pb2
as
profiler_pb2
parser
=
argparse
.
ArgumentParser
(
description
=
__doc__
)
...
...
tools/windows/get_prec_ut_list.py
浏览文件 @
5f25183e
...
...
@@ -13,9 +13,7 @@
# limitations under the License.
"""To get a list of prec ut """
import
sys
import
os
import
platform
def
get_prec_ut_list
(
all_test_cases
,
prec_test_cases
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录