Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
a0aa2ec8
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2305
Star
20932
Fork
5423
代码
文件
提交
分支
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看板
提交
a0aa2ec8
编写于
9月 02, 2018
作者:
D
dzhwinter
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build compile
上级
75681c0a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
7 deletion
+10
-7
cmake/flags.cmake
cmake/flags.cmake
+1
-1
paddle/fluid/inference/api/helper.h
paddle/fluid/inference/api/helper.h
+3
-2
paddle/fluid/operators/cum_op.h
paddle/fluid/operators/cum_op.h
+6
-4
未找到文件。
cmake/flags.cmake
浏览文件 @
a0aa2ec8
...
...
@@ -160,7 +160,7 @@ if(UNIX AND NOT APPLE)
set
(
LINUX TRUE
)
endif
(
UNIX AND NOT APPLE
)
set
(
GPU_COMMON_FLAGS
-std=c++11
${
GPU_COMMON_FLAGS
}
)
set
(
GPU_COMMON_FLAGS
/std:c++14
${
GPU_COMMON_FLAGS
}
)
foreach
(
flag
${
COMMON_FLAGS
}
)
safe_set_cflag
(
CMAKE_C_FLAGS
${
flag
}
)
safe_set_cxxflag
(
CMAKE_CXX_FLAGS
${
flag
}
)
...
...
paddle/fluid/inference/api/helper.h
浏览文件 @
a0aa2ec8
...
...
@@ -15,6 +15,7 @@
#pragma once
#include <algorithm>
#include <iterator>
#include <numeric>
#include <sstream>
#include <string>
...
...
@@ -25,8 +26,8 @@
namespace
paddle
{
namespace
inference
{
static
void
split
(
const
std
::
string
&
str
,
char
sep
,
std
::
vector
<
std
::
string
>
*
pieces
)
{
static
void
split
(
const
std
::
string
&
str
,
char
sep
,
std
::
vector
<
std
::
string
>
*
pieces
)
{
pieces
->
clear
();
if
(
str
.
empty
())
{
return
;
...
...
paddle/fluid/operators/cum_op.h
浏览文件 @
a0aa2ec8
...
...
@@ -85,14 +85,17 @@ class CumKernel : public framework::OpKernel<typename Functor::ELEMENT_TYPE> {
template
<
typename
Device
,
typename
Dim
,
typename
X
,
typename
Out
>
void
ComputeImp
(
Device
d
,
const
Dim
&
dims
,
X
x
,
Out
out
,
int
axis
,
bool
reverse
,
bool
exclusive
)
const
{
Functor
func
();
if
(
!
reverse
)
{
out
.
reshape
(
dims
).
device
(
d
)
=
Functor
()(
x
.
reshape
(
dims
),
axis
,
exclusive
);
out
.
reshape
(
dims
).
device
(
d
)
=
func
.
apply
(
x
.
reshape
(
dims
),
axis
,
exclusive
);
}
else
{
std
::
array
<
bool
,
Dim
::
count
>
rev
;
rev
.
fill
(
false
);
rev
[
axis
]
=
reverse
;
out
.
reshape
(
dims
).
device
(
d
)
=
Functor
()(
x
.
reshape
(
dims
).
reverse
(
rev
),
axis
,
exclusive
).
reverse
(
rev
);
func
.
apply
(
x
.
reshape
(
dims
).
reverse
(
rev
),
axis
,
exclusive
)
.
reverse
(
rev
);
}
}
};
...
...
@@ -101,8 +104,7 @@ template <typename T>
struct
CumsumFunctor
{
using
ELEMENT_TYPE
=
T
;
template
<
typename
X
>
const
typename
X
::
TensorScanSumOp
operator
()(
X
x
,
int
axis
,
bool
exclusive
)
const
{
const
typename
X
::
TensorScanSumOp
apply
(
X
x
,
int
axis
,
bool
exclusive
)
const
{
return
x
.
cumsum
(
axis
,
exclusive
);
}
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录