Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
f2c7d162
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看板
未验证
提交
f2c7d162
编写于
8月 29, 2023
作者:
G
gouzil
提交者:
GitHub
8月 29, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[clang-tidy] enable clang-analyzer-core.uninitialized.Assign check (#56637)
上级
1409e4ec
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
8 addition
and
8 deletion
+8
-8
.clang-tidy
.clang-tidy
+1
-1
paddle/phi/kernels/funcs/activation_functor.h
paddle/phi/kernels/funcs/activation_functor.h
+5
-5
paddle/phi/kernels/funcs/gpc.cc
paddle/phi/kernels/funcs/gpc.cc
+2
-2
未找到文件。
.clang-tidy
浏览文件 @
f2c7d162
...
...
@@ -63,7 +63,7 @@ bugprone-unused-raii,
-clang-analyzer-core.builtin.BuiltinFunctions,
-clang-analyzer-core.builtin.NoReturnFunctions,
-clang-analyzer-core.uninitialized.ArraySubscript,
-
clang-analyzer-core.uninitialized.Assign,
clang-analyzer-core.uninitialized.Assign,
-clang-analyzer-core.uninitialized.Branch,
-clang-analyzer-core.uninitialized.CapturedBlockVariable,
-clang-analyzer-core.uninitialized.UndefReturn,
...
...
paddle/phi/kernels/funcs/activation_functor.h
浏览文件 @
f2c7d162
...
...
@@ -590,7 +590,7 @@ struct STanhGradFunctor : public BaseActivationFunctor<T> {
typename
dOut
,
typename
dX
>
void
operator
()(
Device
d
,
X
x
,
Out
out
UNUSED
,
dOut
dout
,
dX
dx
)
const
{
auto
a
=
static_cast
<
T
>
(
scale_a
);
auto
a
=
static_cast
<
T
>
(
scale_a
);
// NOLINT
auto
b
=
static_cast
<
T
>
(
scale_b
);
auto
temp
=
(
a
*
x
).
tanh
()
*
(
a
*
x
).
tanh
();
dx
.
device
(
d
)
=
dout
*
a
*
b
*
(
static_cast
<
T
>
(
1
)
-
temp
);
...
...
@@ -1557,7 +1557,7 @@ struct ThresholdedReluFunctor : public BaseActivationFunctor<T> {
template
<
typename
Device
,
typename
X
,
typename
Out
>
void
operator
()(
Device
d
,
X
x
,
Out
out
)
const
{
auto
th
=
static_cast
<
T
>
(
threshold
);
auto
th
=
static_cast
<
T
>
(
threshold
);
// NOLINT
out
.
device
(
d
)
=
(
x
>
th
).
template
cast
<
T
>()
*
x
;
}
};
...
...
@@ -1575,7 +1575,7 @@ struct ThresholdedReluGradFunctor : public BaseActivationFunctor<T> {
typename
dOut
,
typename
dX
>
void
operator
()(
Device
d
,
X
x
,
Out
out
UNUSED
,
dOut
dout
,
dX
dx
)
const
{
auto
th
=
static_cast
<
T
>
(
threshold
);
auto
th
=
static_cast
<
T
>
(
threshold
);
// NOLINT
dx
.
device
(
d
)
=
dout
*
(
x
>
th
).
template
cast
<
T
>();
}
...
...
@@ -1692,7 +1692,7 @@ struct SoftShrinkFunctor : public BaseActivationFunctor<T> {
template
<
typename
Device
,
typename
X
,
typename
Out
>
void
operator
()(
Device
d
,
X
x
,
Out
out
)
const
{
auto
lambdaT
=
static_cast
<
T
>
(
lambda
);
auto
lambdaT
=
static_cast
<
T
>
(
lambda
);
// NOLINT
auto
temp1
=
(
x
>
lambdaT
).
template
cast
<
T
>();
auto
temp2
=
(
x
<
-
lambdaT
).
template
cast
<
T
>();
out
.
device
(
d
)
=
temp1
*
(
x
-
lambdaT
)
+
temp2
*
(
x
+
lambdaT
);
...
...
@@ -1711,7 +1711,7 @@ struct SoftShrinkGradFunctor : public BaseActivationFunctor<T> {
typename
dOut
,
typename
dX
>
void
operator
()(
Device
d
,
X
x
,
Out
out
UNUSED
,
dOut
dout
,
dX
dx
)
const
{
auto
lambdaT
=
static_cast
<
T
>
(
lambda
);
auto
lambdaT
=
static_cast
<
T
>
(
lambda
);
// NOLINT
auto
temp1
=
(
x
>
lambdaT
).
template
cast
<
T
>();
auto
temp2
=
(
x
<
-
lambdaT
).
template
cast
<
T
>();
dx
.
device
(
d
)
=
dout
*
(
temp1
+
temp2
).
template
cast
<
T
>();
...
...
paddle/phi/kernels/funcs/gpc.cc
浏览文件 @
f2c7d162
...
...
@@ -1026,7 +1026,7 @@ void gpc_polygon_clip(gpc_op op,
/* Set yb and yt to the bottom and top of the scanbeam */
yb
=
sbt
[
scanbeam
++
];
if
(
scanbeam
<
sbt_entries
)
{
yt
=
sbt
[
scanbeam
];
yt
=
sbt
[
scanbeam
];
// NOLINT
dy
=
yt
-
yb
;
}
/* === SCANBEAM BOUNDARY PROCESSING ================================ */
...
...
@@ -1664,7 +1664,7 @@ void gpc_tristrip_clip(gpc_op op,
/* Set yb and yt to the bottom and top of the scanbeam */
yb
=
sbt
[
scanbeam
++
];
if
(
scanbeam
<
sbt_entries
)
{
yt
=
sbt
[
scanbeam
];
yt
=
sbt
[
scanbeam
];
// NOLINT
dy
=
yt
-
yb
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录