Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
8df8cb10
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看板
未验证
提交
8df8cb10
编写于
2月 13, 2023
作者:
Z
zyfncg
提交者:
GitHub
2月 13, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Delete axis of fmin kernel (#50358)
* delete axis of fmin * fix bug
上级
615d9f53
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
13 addition
and
49 deletion
+13
-49
paddle/phi/api/yaml/legacy_backward.yaml
paddle/phi/api/yaml/legacy_backward.yaml
+1
-1
paddle/phi/kernels/cpu/elementwise_kernel.cc
paddle/phi/kernels/cpu/elementwise_kernel.cc
+2
-8
paddle/phi/kernels/elementwise_grad_kernel.h
paddle/phi/kernels/elementwise_grad_kernel.h
+0
-1
paddle/phi/kernels/elementwise_kernel.cc
paddle/phi/kernels/elementwise_kernel.cc
+0
-21
paddle/phi/kernels/elementwise_kernel.h
paddle/phi/kernels/elementwise_kernel.h
+0
-7
paddle/phi/kernels/impl/elementwise_grad_kernel_impl.h
paddle/phi/kernels/impl/elementwise_grad_kernel_impl.h
+1
-1
paddle/phi/kernels/impl/elementwise_kernel_impl.h
paddle/phi/kernels/impl/elementwise_kernel_impl.h
+5
-6
paddle/phi/kernels/kps/elementwise_kernel.cu
paddle/phi/kernels/kps/elementwise_kernel.cu
+2
-2
paddle/phi/ops/compat/elementwise_sig.cc
paddle/phi/ops/compat/elementwise_sig.cc
+2
-2
未找到文件。
paddle/phi/api/yaml/legacy_backward.yaml
浏览文件 @
8df8cb10
...
...
@@ -515,7 +515,7 @@
-
backward_op
:
fmin_grad
forward
:
fmin(Tensor x, Tensor y) -> Tensor(out)
args
:
(Tensor x, Tensor y, Tensor out_grad
, int axis = -1
)
args
:
(Tensor x, Tensor y, Tensor out_grad)
output
:
Tensor(x_grad), Tensor(y_grad)
infer_meta
:
func
:
GeneralBinaryGradInferMeta
...
...
paddle/phi/kernels/cpu/elementwise_kernel.cc
浏览文件 @
8df8cb10
...
...
@@ -131,14 +131,8 @@ PD_REGISTER_KERNEL(fmax_raw,
int
,
int64_t
)
{}
PD_REGISTER_KERNEL
(
fmin_raw
,
CPU
,
ALL_LAYOUT
,
phi
::
FMinRawKernel
,
float
,
double
,
int
,
int64_t
)
{}
PD_REGISTER_KERNEL
(
fmin
,
CPU
,
ALL_LAYOUT
,
phi
::
FMinKernel
,
float
,
double
,
int
,
int64_t
)
{}
PD_REGISTER_KERNEL
(
maximum_raw
,
CPU
,
...
...
paddle/phi/kernels/elementwise_grad_kernel.h
浏览文件 @
8df8cb10
...
...
@@ -33,7 +33,6 @@ void ElementwiseFMinGradKernel(const Context& dev_ctx,
const
DenseTensor
&
x
,
const
DenseTensor
&
y
,
const
DenseTensor
&
out_grad
,
int
axis
,
DenseTensor
*
x_grad
,
DenseTensor
*
y_grad
);
...
...
paddle/phi/kernels/elementwise_kernel.cc
浏览文件 @
8df8cb10
...
...
@@ -118,14 +118,6 @@ void FMaxKernel(const Context& dev_ctx,
FMaxRawKernel
<
T
,
Context
>
(
dev_ctx
,
x
,
y
,
-
1
,
out
);
}
template
<
typename
T
,
typename
Context
>
void
FMinKernel
(
const
Context
&
dev_ctx
,
const
DenseTensor
&
x
,
const
DenseTensor
&
y
,
DenseTensor
*
out
)
{
FMinRawKernel
<
T
,
Context
>
(
dev_ctx
,
x
,
y
,
-
1
,
out
);
}
}
// namespace phi
using
complex64
=
::
phi
::
dtype
::
complex
<
float
>
;
using
complex128
=
::
phi
::
dtype
::
complex
<
double
>
;
...
...
@@ -133,9 +125,6 @@ using complex128 = ::phi::dtype::complex<double>;
PD_REGISTER_KERNEL
(
fmax
,
CPU
,
ALL_LAYOUT
,
phi
::
FMaxKernel
,
float
,
double
,
int
,
int64_t
)
{}
PD_REGISTER_KERNEL
(
fmin
,
CPU
,
ALL_LAYOUT
,
phi
::
FMinKernel
,
float
,
double
,
int
,
int64_t
)
{}
PD_REGISTER_KERNEL
(
maximum
,
CPU
,
ALL_LAYOUT
,
...
...
@@ -242,16 +231,6 @@ PD_REGISTER_KERNEL(fmax,
phi
::
dtype
::
float16
,
int64_t
)
{}
PD_REGISTER_KERNEL
(
fmin
,
KPS
,
ALL_LAYOUT
,
phi
::
FMinKernel
,
float
,
double
,
int
,
phi
::
dtype
::
float16
,
int64_t
)
{}
PD_REGISTER_KERNEL
(
maximum
,
KPS
,
ALL_LAYOUT
,
...
...
paddle/phi/kernels/elementwise_kernel.h
浏览文件 @
8df8cb10
...
...
@@ -32,13 +32,6 @@ void FMaxKernel(const Context& dev_ctx,
const
DenseTensor
&
y
,
DenseTensor
*
out
);
template
<
typename
T
,
typename
Context
>
void
FMinRawKernel
(
const
Context
&
dev_ctx
,
const
DenseTensor
&
x
,
const
DenseTensor
&
y
,
int
axis
,
DenseTensor
*
out
);
template
<
typename
T
,
typename
Context
>
void
FMinKernel
(
const
Context
&
dev_ctx
,
const
DenseTensor
&
x
,
...
...
paddle/phi/kernels/impl/elementwise_grad_kernel_impl.h
浏览文件 @
8df8cb10
...
...
@@ -314,13 +314,13 @@ void ElementwiseFMinGradKernel(const Context& dev_ctx,
const
DenseTensor
&
x
,
const
DenseTensor
&
y
,
const
DenseTensor
&
out_grad
,
int
axis
,
DenseTensor
*
x_grad
,
DenseTensor
*
y_grad
)
{
funcs
::
ElementwiseGradPreProcess
(
out_grad
,
x_grad
);
auto
out
=
out_grad
;
// Fake out, not used
auto
x_dim
=
x
.
dims
();
auto
y_dim
=
y
.
dims
();
int
axis
=
-
1
;
if
(
x
.
dims
()
==
y
.
dims
())
{
funcs
::
ElemwiseGradComputeNoBroadcast
<
Context
,
T
,
...
...
paddle/phi/kernels/impl/elementwise_kernel_impl.h
浏览文件 @
8df8cb10
...
...
@@ -78,14 +78,13 @@ void FMaxRawKernel(const Context& dev_ctx,
}
template
<
typename
T
,
typename
Context
>
void
FMinRawKernel
(
const
Context
&
dev_ctx
,
const
DenseTensor
&
x
,
const
DenseTensor
&
y
,
int
axis
,
DenseTensor
*
out
)
{
void
FMinKernel
(
const
Context
&
dev_ctx
,
const
DenseTensor
&
x
,
const
DenseTensor
&
y
,
DenseTensor
*
out
)
{
dev_ctx
.
template
Alloc
<
T
>(
out
);
funcs
::
ElementwiseCompute
<
funcs
::
FMinFunctor
<
T
>
,
T
,
T
>
(
dev_ctx
,
x
,
y
,
axis
,
funcs
::
FMinFunctor
<
T
>
(),
out
);
dev_ctx
,
x
,
y
,
-
1
,
funcs
::
FMinFunctor
<
T
>
(),
out
);
}
}
// namespace phi
paddle/phi/kernels/kps/elementwise_kernel.cu
浏览文件 @
8df8cb10
...
...
@@ -103,10 +103,10 @@ PD_REGISTER_KERNEL(fmax_raw,
float16
,
int64_t
)
{}
PD_REGISTER_KERNEL
(
fmin
_raw
,
PD_REGISTER_KERNEL
(
fmin
,
KPS
,
ALL_LAYOUT
,
phi
::
FMin
Raw
Kernel
,
phi
::
FMinKernel
,
float
,
double
,
int
,
...
...
paddle/phi/ops/compat/elementwise_sig.cc
浏览文件 @
8df8cb10
...
...
@@ -162,7 +162,7 @@ KernelSignature ElementwiseDivGradOpArgumentMapping(
KernelSignature
ElementwiseFMinGradOpArgumentMapping
(
const
ArgumentMappingContext
&
ctx
)
{
return
KernelSignature
(
"fmin_grad"
,
{
"X"
,
"Y"
,
"Out@GRAD"
},
{
"axis"
},
{
"X@GRAD"
,
"Y@GRAD"
});
"fmin_grad"
,
{
"X"
,
"Y"
,
"Out@GRAD"
},
{},
{
"X@GRAD"
,
"Y@GRAD"
});
}
KernelSignature
ElementwiseDivDoubleGradOpArgumentMapping
(
...
...
@@ -186,7 +186,7 @@ KernelSignature ElementwiseFMaxOpArgumentMapping(
KernelSignature
ElementwiseFMinOpArgumentMapping
(
const
ArgumentMappingContext
&
ctx
)
{
return
KernelSignature
(
"fmin
_raw"
,
{
"X"
,
"Y"
},
{
"axis"
},
{
"Out"
});
return
KernelSignature
(
"fmin
"
,
{
"X"
,
"Y"
},
{
},
{
"Out"
});
}
KernelSignature
ElementwiseFMaxGradOpArgumentMapping
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录