Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
9ca578d4
P
Paddle
项目概览
Crayon鑫
/
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看板
提交
9ca578d4
编写于
4月 18, 2018
作者:
A
Abhinav Arora
提交者:
Yang Yang(Tony)
4月 18, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix CPPLint issues in expand_op, gather_op and get_places_op (#10000)
上级
98c12b1a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
23 addition
and
22 deletion
+23
-22
paddle/fluid/operators/expand_op.cc
paddle/fluid/operators/expand_op.cc
+1
-0
paddle/fluid/operators/expand_op.h
paddle/fluid/operators/expand_op.h
+2
-1
paddle/fluid/operators/gather_op.cu
paddle/fluid/operators/gather_op.cu
+2
-2
paddle/fluid/operators/gather_op.h
paddle/fluid/operators/gather_op.h
+2
-2
paddle/fluid/operators/gather_test.cc
paddle/fluid/operators/gather_test.cc
+15
-16
paddle/fluid/operators/get_places_op.cc
paddle/fluid/operators/get_places_op.cc
+1
-1
未找到文件。
paddle/fluid/operators/expand_op.cc
浏览文件 @
9ca578d4
...
...
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/fluid/operators/expand_op.h"
#include <vector>
#include <vector>
...
...
paddle/fluid/operators/expand_op.h
浏览文件 @
9ca578d4
...
...
@@ -14,13 +14,14 @@ limitations under the License. */
#pragma once
#include <vector>
#include <boost/preprocessor/arithmetic/div.hpp>
#include <boost/preprocessor/arithmetic/mod.hpp>
#include <boost/preprocessor/comparison/greater.hpp>
#include <boost/preprocessor/comparison/greater_equal.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <iostream>
#include "paddle/fluid/framework/eigen.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/framework/operator.h"
...
...
paddle/fluid/operators/gather_op.cu
浏览文件 @
9ca578d4
...
...
@@ -12,10 +12,10 @@ 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. */
#include "gather.cu.h"
#include "paddle/fluid/framework/eigen.h"
#include "paddle/fluid/operators/gather.cu.h"
#include "paddle/fluid/operators/gather_op.h"
#include "scatter.cu.h"
#include "
paddle/fluid/operators/
scatter.cu.h"
namespace
paddle
{
namespace
operators
{
...
...
paddle/fluid/operators/gather_op.h
浏览文件 @
9ca578d4
...
...
@@ -13,10 +13,10 @@ See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#include "gather.h"
#include "paddle/fluid/framework/eigen.h"
#include "paddle/fluid/framework/op_registry.h"
#include "scatter.h"
#include "paddle/fluid/operators/gather.h"
#include "paddle/fluid/operators/scatter.h"
namespace
paddle
{
namespace
operators
{
...
...
paddle/fluid/operators/gather_test.cc
浏览文件 @
9ca578d4
...
...
@@ -12,38 +12,37 @@ 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. */
#include "paddle/fluid/operators/gather.h"
#include "paddle/fluid/framework/ddim.h"
#include "paddle/fluid/framework/tensor.h"
#include "paddle/fluid/platform/place.h"
#include <gtest/gtest.h>
#include <iostream>
#include <string>
TEST
(
Gather
,
GatherData
)
{
using
namespace
paddle
::
framework
;
using
namespace
paddle
::
platform
;
using
namespace
paddle
::
operators
;
#include "paddle/fluid/framework/ddim.h"
#include "paddle/fluid/framework/tensor.h"
#include "paddle/fluid/operators/gather.h"
#include "paddle/fluid/platform/place.h"
Tensor
*
src
=
new
Tensor
();
Tensor
*
index
=
new
Tensor
();
Tensor
*
output
=
new
Tensor
();
TEST
(
Gather
,
GatherData
)
{
paddle
::
framework
::
Tensor
*
src
=
new
paddle
::
framework
::
Tensor
();
paddle
::
framework
::
Tensor
*
index
=
new
paddle
::
framework
::
Tensor
();
paddle
::
framework
::
Tensor
*
output
=
new
paddle
::
framework
::
Tensor
();
int
*
p_src
=
nullptr
;
int
*
p_index
=
nullptr
;
p_src
=
src
->
mutable_data
<
int
>
(
make_ddim
({
3
,
4
}),
CPUPlace
());
p_index
=
index
->
mutable_data
<
int
>
(
make_ddim
({
2
}),
CPUPlace
());
p_src
=
src
->
mutable_data
<
int
>
(
paddle
::
framework
::
make_ddim
({
3
,
4
}),
paddle
::
platform
::
CPUPlace
());
p_index
=
index
->
mutable_data
<
int
>
(
paddle
::
framework
::
make_ddim
({
2
}),
paddle
::
platform
::
CPUPlace
());
for
(
int
i
=
0
;
i
<
12
;
++
i
)
p_src
[
i
]
=
i
;
p_index
[
0
]
=
1
;
p_index
[
1
]
=
0
;
int
*
p_output
=
output
->
mutable_data
<
int
>
(
make_ddim
({
2
,
4
}),
CPUPlace
());
int
*
p_output
=
output
->
mutable_data
<
int
>
(
paddle
::
framework
::
make_ddim
({
2
,
4
}),
paddle
::
platform
::
CPUPlace
());
auto
*
cpu_place
=
new
paddle
::
platform
::
CPUPlace
();
paddle
::
platform
::
CPUDeviceContext
ctx
(
*
cpu_place
);
CPUGather
<
int
>
(
ctx
,
*
src
,
*
index
,
output
);
paddle
::
operators
::
CPUGather
<
int
>
(
ctx
,
*
src
,
*
index
,
output
);
for
(
int
i
=
0
;
i
<
4
;
++
i
)
EXPECT_EQ
(
p_output
[
i
],
i
+
4
);
for
(
int
i
=
4
;
i
<
8
;
++
i
)
EXPECT_EQ
(
p_output
[
i
],
i
-
4
);
...
...
paddle/fluid/operators/get_places_op.cc
浏览文件 @
9ca578d4
...
...
@@ -12,7 +12,7 @@ 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. */
#include <thread>
#include <thread>
// NOLINT
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/operators/detail/safe_ref.h"
#include "paddle/fluid/platform/place.h"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录