Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
839d8bb3
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
839d8bb3
编写于
8月 07, 2022
作者:
C
Chen Weihang
提交者:
GitHub
8月 07, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix kernels header pos error (#44902)
* fix header pos error * fix namespace error
上级
849eccb7
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
27 addition
and
43 deletion
+27
-43
paddle/phi/kernels/affine_grid_grad_kernel.h
paddle/phi/kernels/affine_grid_grad_kernel.h
+0
-1
paddle/phi/kernels/affine_grid_kernel.h
paddle/phi/kernels/affine_grid_kernel.h
+0
-1
paddle/phi/kernels/cpu/affine_grid_grad_kernel.cc
paddle/phi/kernels/cpu/affine_grid_grad_kernel.cc
+2
-0
paddle/phi/kernels/cpu/affine_grid_kernel.cc
paddle/phi/kernels/cpu/affine_grid_kernel.cc
+2
-0
paddle/phi/kernels/cpu/fill_diagonal_grad_kernel.cc
paddle/phi/kernels/cpu/fill_diagonal_grad_kernel.cc
+2
-1
paddle/phi/kernels/cpu/fill_diagonal_kernel.cc
paddle/phi/kernels/cpu/fill_diagonal_kernel.cc
+2
-1
paddle/phi/kernels/fill_diagonal_grad_kernel.h
paddle/phi/kernels/fill_diagonal_grad_kernel.h
+0
-2
paddle/phi/kernels/fill_diagonal_kernel.h
paddle/phi/kernels/fill_diagonal_kernel.h
+0
-3
paddle/phi/kernels/funcs/affine_grid_utils.h
paddle/phi/kernels/funcs/affine_grid_utils.h
+0
-0
paddle/phi/kernels/funcs/common_shape.h
paddle/phi/kernels/funcs/common_shape.h
+11
-0
paddle/phi/kernels/gpu/affine_grid_grad_kernel.cu
paddle/phi/kernels/gpu/affine_grid_grad_kernel.cu
+2
-0
paddle/phi/kernels/gpu/affine_grid_kernel.cu
paddle/phi/kernels/gpu/affine_grid_kernel.cu
+2
-0
paddle/phi/kernels/gpu/fill_diagonal_grad_kernel.cu
paddle/phi/kernels/gpu/fill_diagonal_grad_kernel.cu
+2
-1
paddle/phi/kernels/gpu/fill_diagonal_kernel.cu
paddle/phi/kernels/gpu/fill_diagonal_kernel.cu
+2
-1
paddle/phi/kernels/impl/fill_diagonal_kernel_impl.h
paddle/phi/kernels/impl/fill_diagonal_kernel_impl.h
+0
-32
未找到文件。
paddle/phi/kernels/affine_grid_grad_kernel.h
浏览文件 @
839d8bb3
...
...
@@ -15,7 +15,6 @@
#pragma once
#include "paddle/phi/common/int_array.h"
#include "paddle/phi/kernels/affine_grid_impl.h"
namespace
phi
{
...
...
paddle/phi/kernels/affine_grid_kernel.h
浏览文件 @
839d8bb3
...
...
@@ -15,7 +15,6 @@
#pragma once
#include "paddle/phi/common/int_array.h"
#include "paddle/phi/kernels/affine_grid_impl.h"
namespace
phi
{
...
...
paddle/phi/kernels/cpu/affine_grid_grad_kernel.cc
浏览文件 @
839d8bb3
...
...
@@ -13,9 +13,11 @@
// limitations under the License.
#include "paddle/phi/kernels/affine_grid_grad_kernel.h"
#include "paddle/phi/backends/cpu/cpu_context.h"
#include "paddle/phi/common/int_array.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/funcs/affine_grid_utils.h"
namespace
phi
{
...
...
paddle/phi/kernels/cpu/affine_grid_kernel.cc
浏览文件 @
839d8bb3
...
...
@@ -13,9 +13,11 @@
// limitations under the License.
#include "paddle/phi/kernels/affine_grid_kernel.h"
#include "paddle/phi/backends/cpu/cpu_context.h"
#include "paddle/phi/common/int_array.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/funcs/affine_grid_utils.h"
namespace
phi
{
...
...
paddle/phi/kernels/cpu/fill_diagonal_grad_kernel.cc
浏览文件 @
839d8bb3
...
...
@@ -15,6 +15,7 @@
#include "paddle/phi/kernels/fill_diagonal_grad_kernel.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/funcs/common_shape.h"
namespace
phi
{
...
...
@@ -30,7 +31,7 @@ void FillDiagonalGradKernel(const Context& ctx,
phi
::
Copy
(
ctx
,
out_grad
,
ctx
.
GetPlace
(),
false
,
x_grad
);
auto
dx_dims
=
x_grad
->
dims
();
auto
strides
=
CalStride
(
dx_dims
);
auto
strides
=
funcs
::
CalStride
(
dx_dims
);
auto
size
=
x_grad
->
numel
();
auto
wrapsize
=
std
::
min
(
size
,
dx_dims
[
1
]
*
dx_dims
[
1
]);
...
...
paddle/phi/kernels/cpu/fill_diagonal_kernel.cc
浏览文件 @
839d8bb3
...
...
@@ -16,6 +16,7 @@
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/core/tensor_utils.h"
#include "paddle/phi/kernels/funcs/common_shape.h"
namespace
phi
{
...
...
@@ -32,7 +33,7 @@ void FillDiagonalKernel(const Context& ctx,
phi
::
Copy
(
ctx
,
x
,
ctx
.
GetPlace
(),
false
,
out
);
auto
out_dims
=
out
->
dims
();
auto
strides
=
CalStride
(
out_dims
);
auto
strides
=
funcs
::
CalStride
(
out_dims
);
auto
size
=
out
->
numel
();
// The wrap mode supported only the dims equels to 2; In wrap mode, the
...
...
paddle/phi/kernels/fill_diagonal_grad_kernel.h
浏览文件 @
839d8bb3
...
...
@@ -16,8 +16,6 @@
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/kernels/impl/fill_diagonal_kernel_impl.h"
namespace
phi
{
template
<
typename
T
,
typename
Context
>
...
...
paddle/phi/kernels/fill_diagonal_kernel.h
浏览文件 @
839d8bb3
...
...
@@ -15,9 +15,6 @@
#pragma once
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/kernels/impl/fill_diagonal_kernel_impl.h"
namespace
phi
{
template
<
typename
T
,
typename
Context
>
...
...
paddle/phi/kernels/
affine_grid_impl
.h
→
paddle/phi/kernels/
funcs/affine_grid_utils
.h
浏览文件 @
839d8bb3
文件已移动
paddle/phi/kernels/funcs/common_shape.h
浏览文件 @
839d8bb3
...
...
@@ -231,5 +231,16 @@ inline DDim GetOutputDims(const DDim &s_dims, const DDim &l_dims) {
return
phi
::
make_ddim
(
shapes
);
}
inline
int64_t
CalStride
(
phi
::
DDim
dim
)
{
int
rank
=
dim
.
size
();
int64_t
dimsum
=
1
;
int64_t
strides
=
0
;
for
(
int
i
=
rank
-
1
;
i
>=
0
;
i
--
)
{
strides
+=
dimsum
;
dimsum
*=
dim
[
i
];
}
return
strides
;
}
}
// namespace funcs
}
// namespace phi
paddle/phi/kernels/gpu/affine_grid_grad_kernel.cu
浏览文件 @
839d8bb3
...
...
@@ -15,6 +15,7 @@
#pragma once
#include "paddle/phi/kernels/affine_grid_grad_kernel.h"
#include "paddle/fluid/platform/device/gpu/gpu_device_function.h"
#include "paddle/fluid/platform/device/gpu/gpu_info.h"
#include "paddle/fluid/platform/device/gpu/gpu_primitives.h"
...
...
@@ -22,6 +23,7 @@
#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/common/int_array.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/funcs/affine_grid_utils.h"
namespace
phi
{
...
...
paddle/phi/kernels/gpu/affine_grid_kernel.cu
浏览文件 @
839d8bb3
...
...
@@ -15,6 +15,7 @@
#pragma once
#include "paddle/phi/kernels/affine_grid_kernel.h"
#include "paddle/fluid/platform/device/gpu/gpu_device_function.h"
#include "paddle/fluid/platform/device/gpu/gpu_info.h"
#include "paddle/fluid/platform/device/gpu/gpu_primitives.h"
...
...
@@ -22,6 +23,7 @@
#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/common/int_array.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/funcs/affine_grid_utils.h"
namespace
phi
{
...
...
paddle/phi/kernels/gpu/fill_diagonal_grad_kernel.cu
浏览文件 @
839d8bb3
...
...
@@ -18,6 +18,7 @@
#include <vector>
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/funcs/common_shape.h"
namespace
phi
{
...
...
@@ -60,7 +61,7 @@ void FillDiagonalGradKernel(const Context& ctx,
auto
size
=
x_grad
->
numel
();
auto
out_dims
=
x_grad
->
dims
();
auto
strides
=
CalStride
(
out_dims
);
auto
strides
=
funcs
::
CalStride
(
out_dims
);
auto
wrapsize
=
std
::
min
(
size
,
out_dims
[
1
]
*
out_dims
[
1
]);
// The wrap mode supported only the dims equels to 2; In wrap mode, the
...
...
paddle/phi/kernels/gpu/fill_diagonal_kernel.cu
浏览文件 @
839d8bb3
...
...
@@ -19,6 +19,7 @@
#include "paddle/fluid/framework/convert_utils.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/funcs/common_shape.h"
namespace
phi
{
...
...
@@ -63,7 +64,7 @@ void FillDiagonalKernel(const Context& ctx,
auto
size
=
out
->
numel
();
auto
out_dims
=
out
->
dims
();
auto
strides
=
CalStride
(
out_dims
);
auto
strides
=
funcs
::
CalStride
(
out_dims
);
// The wrap mode supported only the dims equels to 2; In wrap mode, the
// value will be filled in cycles
...
...
paddle/phi/kernels/impl/fill_diagonal_kernel_impl.h
已删除
100644 → 0
浏览文件 @
849eccb7
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// 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.
#pragma once
#include "paddle/phi/core/dense_tensor.h"
namespace
phi
{
inline
int64_t
CalStride
(
phi
::
DDim
dim
)
{
int
rank
=
dim
.
size
();
int64_t
dimsum
=
1
;
int64_t
strides
=
0
;
for
(
int
i
=
rank
-
1
;
i
>=
0
;
i
--
)
{
strides
+=
dimsum
;
dimsum
*=
dim
[
i
];
}
return
strides
;
}
}
// namespace phi
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录