Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
2c307457
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看板
未验证
提交
2c307457
编写于
8月 14, 2023
作者:
C
cyberslack_lee
提交者:
GitHub
8月 14, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[clang-tidy] No.31 enable modernize-use-bool-literals (#56216)
上级
0cae0151
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
23 addition
and
23 deletion
+23
-23
.clang-tidy
.clang-tidy
+1
-1
paddle/fluid/framework/hogwild_worker.cc
paddle/fluid/framework/hogwild_worker.cc
+2
-2
paddle/fluid/framework/io/shell.cc
paddle/fluid/framework/io/shell.cc
+1
-1
paddle/fluid/framework/ir/transfer_layout_elim_pass.cc
paddle/fluid/framework/ir/transfer_layout_elim_pass.cc
+1
-1
paddle/fluid/framework/trainer.cc
paddle/fluid/framework/trainer.cc
+1
-1
paddle/fluid/inference/analysis/ir_pass_manager.cc
paddle/fluid/inference/analysis/ir_pass_manager.cc
+2
-2
paddle/fluid/inference/api/analysis_predictor.cc
paddle/fluid/inference/api/analysis_predictor.cc
+1
-1
paddle/fluid/inference/api/onnxruntime_predictor.cc
paddle/fluid/inference/api/onnxruntime_predictor.cc
+1
-1
paddle/fluid/memory/allocation/buddy_allocator.cc
paddle/fluid/memory/allocation/buddy_allocator.cc
+1
-1
paddle/fluid/operators/fused/fused_embedding_eltwise_layernorm_op.cc
...d/operators/fused/fused_embedding_eltwise_layernorm_op.cc
+2
-2
paddle/fluid/operators/fused/fused_seqpool_cvm_op.cc
paddle/fluid/operators/fused/fused_seqpool_cvm_op.cc
+2
-2
paddle/fluid/operators/generator/get_expected_kernel_func.cc
paddle/fluid/operators/generator/get_expected_kernel_func.cc
+2
-2
paddle/fluid/operators/partial_concat_op.cc
paddle/fluid/operators/partial_concat_op.cc
+2
-2
paddle/fluid/operators/partial_sum_op.cc
paddle/fluid/operators/partial_sum_op.cc
+2
-2
paddle/phi/api/profiler/device_tracer.cc
paddle/phi/api/profiler/device_tracer.cc
+1
-1
paddle/phi/kernels/funcs/gpc.cc
paddle/phi/kernels/funcs/gpc.cc
+1
-1
未找到文件。
.clang-tidy
浏览文件 @
2c307457
...
...
@@ -179,7 +179,7 @@ modernize-redundant-void-arg,
-modernize-replace-random-shuffle,
-modernize-shrink-to-fit,
-modernize-unary-static-assert,
-
modernize-use-bool-literals,
modernize-use-bool-literals,
modernize-use-emplace,
modernize-use-equals-default,
-modernize-use-equals-delete,
...
...
paddle/fluid/framework/hogwild_worker.cc
浏览文件 @
2c307457
...
...
@@ -213,7 +213,7 @@ void HogwildWorker::TrainFilesWithProfiler() {
#if defined(PADDLE_WITH_GPU_GRAPH) && defined(PADDLE_WITH_HETERPS)
device_reader_
->
InitGraphTrainResource
();
#endif
while
(
1
)
{
while
(
true
)
{
cur_batch
=
device_reader_
->
Next
();
#if defined(PADDLE_WITH_GPU_GRAPH)
if
(
is_multi_node
)
{
...
...
@@ -348,7 +348,7 @@ void HogwildWorker::TrainFiles() {
#if defined(PADDLE_WITH_GPU_GRAPH) && defined(PADDLE_WITH_HETERPS)
device_reader_
->
InitGraphTrainResource
();
#endif
while
(
1
)
{
while
(
true
)
{
cur_batch
=
device_reader_
->
Next
();
#if defined(PADDLE_WITH_GPU_GRAPH)
if
(
is_multi_node
)
{
...
...
paddle/fluid/framework/io/shell.cc
浏览文件 @
2c307457
...
...
@@ -152,7 +152,7 @@ static int shell_popen_fork_internal(const char* real_cmd,
static
int
read_from_pipe
(
FILE
*
fp
,
std
::
string
*
output
)
{
std
::
array
<
char
,
4096
>
buf
;
while
(
1
)
{
while
(
true
)
{
int
n
=
fread
(
buf
.
data
(),
1
,
4096
,
fp
);
if
(
n
<=
0
)
{
break
;
...
...
paddle/fluid/framework/ir/transfer_layout_elim_pass.cc
浏览文件 @
2c307457
...
...
@@ -153,7 +153,7 @@ bool TransferLayoutElimPass::AllInputIsTransferlayout(
for
(
auto
var
:
op_node
->
inputs
)
{
// If this input is a 1D persistable tensor,we allow transfer_layout not
// appear before this var, but temporarily diasble this if.
if
(
var
->
Var
()
->
Persistable
()
&&
0
)
{
if
(
var
->
Var
()
->
Persistable
()
&&
false
)
{
auto
var_dims
=
scope
->
FindVar
(
var
->
Name
())
->
GetMutable
<
phi
::
DenseTensor
>
()
->
dims
();
if
(
var_dims
.
size
()
==
1
)
{
...
...
paddle/fluid/framework/trainer.cc
浏览文件 @
2c307457
...
...
@@ -59,7 +59,7 @@ void TrainerBase::DumpWork(int tid) {
// GetDumpPath is implemented in each Trainer
std
::
string
path
=
GetDumpPath
(
tid
);
std
::
shared_ptr
<
FILE
>
fp
=
fs_open_write
(
path
,
&
err_no
,
dump_converter_
);
while
(
1
)
{
while
(
true
)
{
std
::
string
out_str
;
if
(
!
queue_
->
Get
(
out_str
))
{
break
;
...
...
paddle/fluid/inference/analysis/ir_pass_manager.cc
浏览文件 @
2c307457
...
...
@@ -328,10 +328,10 @@ void IRPassManager::CreatePasses(Argument *argument,
argument
->
nnadapter_model_cache_token
()));
}
else
if
(
pass_name
==
"fc_fuse_pass"
)
{
pass
->
Set
(
"use_gpu"
,
new
bool
(
argument
->
use_gpu
()));
bool
fc_mkldnn_pass
=
0
;
bool
fc_mkldnn_pass
=
false
;
for
(
const
std
::
string
&
pass_n
:
passes
)
{
if
(
pass_n
==
"fc_mkldnn_pass"
)
{
fc_mkldnn_pass
=
1
;
fc_mkldnn_pass
=
true
;
}
}
bool
use_fc_padding
=
!
fc_mkldnn_pass
&&
argument
->
use_fc_padding
();
...
...
paddle/fluid/inference/api/analysis_predictor.cc
浏览文件 @
2c307457
...
...
@@ -1708,7 +1708,7 @@ CreatePaddlePredictor<AnalysisConfig, PaddleEngineKind::kAnalysis>(
// TODO(NHZlX): Should add the link to the doc of
// paddle_infer::CreatePredictor<paddle_infer::Config>
if
(
config
.
glog_info_disabled
())
{
FLAGS_logtostderr
=
1
;
FLAGS_logtostderr
=
true
;
FLAGS_minloglevel
=
2
;
// GLOG_ERROR
}
...
...
paddle/fluid/inference/api/onnxruntime_predictor.cc
浏览文件 @
2c307457
...
...
@@ -198,7 +198,7 @@ std::unique_ptr<PaddlePredictor>
CreatePaddlePredictor
<
AnalysisConfig
,
PaddleEngineKind
::
kONNXRuntime
>
(
const
AnalysisConfig
&
config
)
{
if
(
config
.
glog_info_disabled
())
{
FLAGS_logtostderr
=
1
;
FLAGS_logtostderr
=
true
;
FLAGS_minloglevel
=
2
;
// GLOG_ERROR
}
...
...
paddle/fluid/memory/allocation/buddy_allocator.cc
浏览文件 @
2c307457
...
...
@@ -282,7 +282,7 @@ BuddyAllocator::PoolSet::iterator BuddyAllocator::RefillPool(
BuddyAllocator
::
PoolSet
::
iterator
BuddyAllocator
::
FindExistChunk
(
size_t
size
)
{
size_t
index
=
0
;
while
(
1
)
{
while
(
true
)
{
auto
it
=
pool_
.
lower_bound
(
IndexSizeAddress
(
index
,
size
,
nullptr
));
// no match chunk memory
...
...
paddle/fluid/operators/fused/fused_embedding_eltwise_layernorm_op.cc
浏览文件 @
2c307457
...
...
@@ -107,11 +107,11 @@ class EmbeddingEltWiseLayerNormOp : public framework::OperatorWithKernel {
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
auto
inputs
=
ctx
.
MultiInput
<
phi
::
DenseTensor
>
(
"Embs"
);
auto
input_data_type
=
framework
::
proto
::
VarType
::
Type
(
0
);
bool
flag
=
0
;
bool
flag
=
false
;
for
(
auto
*
input
:
inputs
)
{
if
(
input
->
IsInitialized
()
&&
input
->
numel
()
>
0
)
{
input_data_type
=
framework
::
TransToProtoVarType
(
input
->
dtype
());
flag
=
1
;
flag
=
true
;
break
;
}
}
...
...
paddle/fluid/operators/fused/fused_seqpool_cvm_op.cc
浏览文件 @
2c307457
...
...
@@ -135,11 +135,11 @@ class FusedSeqpoolCVMOp : public framework::OperatorWithKernel {
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
auto
inputs
=
ctx
.
MultiInput
<
phi
::
DenseTensor
>
(
"X"
);
auto
input_data_type
=
framework
::
proto
::
VarType
::
Type
(
0
);
bool
flag
=
0
;
bool
flag
=
false
;
for
(
auto
*
input
:
inputs
)
{
if
(
input
->
IsInitialized
()
&&
input
->
numel
()
>
0
)
{
input_data_type
=
framework
::
TransToProtoVarType
(
input
->
dtype
());
flag
=
1
;
flag
=
true
;
break
;
}
}
...
...
paddle/fluid/operators/generator/get_expected_kernel_func.cc
浏览文件 @
2c307457
...
...
@@ -91,11 +91,11 @@ phi::KernelKey GetConcatExpectedKernelType(
(
void
)
op_ptr
;
auto
inputs
=
ctx
.
MultiInput
<
phi
::
DenseTensor
>
(
"X"
);
auto
input_data_type
=
framework
::
proto
::
VarType
::
Type
(
0
);
bool
flag
=
0
;
bool
flag
=
false
;
for
(
auto
*
input
:
inputs
)
{
if
(
input
->
IsInitialized
())
{
input_data_type
=
framework
::
TransToProtoVarType
(
input
->
dtype
());
flag
=
1
;
flag
=
true
;
break
;
}
}
...
...
paddle/fluid/operators/partial_concat_op.cc
浏览文件 @
2c307457
...
...
@@ -93,11 +93,11 @@ class PartialConcatOp : public framework::OperatorWithKernel {
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
auto
inputs
=
ctx
.
MultiInput
<
phi
::
DenseTensor
>
(
"X"
);
auto
input_data_type
=
framework
::
proto
::
VarType
::
Type
(
0
);
bool
flag
=
0
;
bool
flag
=
false
;
for
(
auto
*
input
:
inputs
)
{
if
(
input
->
IsInitialized
())
{
input_data_type
=
framework
::
TransToProtoVarType
(
input
->
dtype
());
flag
=
1
;
flag
=
true
;
break
;
}
}
...
...
paddle/fluid/operators/partial_sum_op.cc
浏览文件 @
2c307457
...
...
@@ -95,11 +95,11 @@ class PartialSumOp : public framework::OperatorWithKernel {
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
auto
inputs
=
ctx
.
MultiInput
<
phi
::
DenseTensor
>
(
"X"
);
auto
input_data_type
=
framework
::
proto
::
VarType
::
Type
(
0
);
bool
flag
=
0
;
bool
flag
=
false
;
for
(
auto
*
input
:
inputs
)
{
if
(
input
->
IsInitialized
())
{
input_data_type
=
framework
::
TransToProtoVarType
(
input
->
dtype
());
flag
=
1
;
flag
=
true
;
break
;
}
}
...
...
paddle/phi/api/profiler/device_tracer.cc
浏览文件 @
2c307457
...
...
@@ -296,7 +296,7 @@ void CUPTIAPI bufferCompleted(CUcontext ctx,
}
else
{
CUPTI_CALL
(
status
);
}
}
while
(
1
);
}
while
(
true
);
size_t
dropped
;
CUPTI_CALL
(
...
...
paddle/phi/kernels/funcs/gpc.cc
浏览文件 @
2c307457
...
...
@@ -2195,7 +2195,7 @@ void gpc_tristrip_clip(gpc_op op,
tn
->
active
*
sizeof
(
gpc_vertex
),
const_cast
<
char
*>
(
"tristrip creation"
));
v
=
0
;
if
(
0
)
{
if
(
false
)
{
lt
=
tn
->
v
[
RIGHT
];
rt
=
tn
->
v
[
LEFT
];
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录