Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
b2f72768
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看板
提交
b2f72768
编写于
3月 20, 2017
作者:
L
Luo Tao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unnecessary UserDefinedVector
上级
53090e34
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
0 addition
and
59 deletion
+0
-59
paddle/gserver/dataproviders/DataProvider.h
paddle/gserver/dataproviders/DataProvider.h
+0
-9
paddle/parameter/Argument.cpp
paddle/parameter/Argument.cpp
+0
-43
paddle/parameter/Argument.h
paddle/parameter/Argument.h
+0
-7
未找到文件。
paddle/gserver/dataproviders/DataProvider.h
浏览文件 @
b2f72768
...
...
@@ -164,15 +164,6 @@ public:
argu
.
value
=
value
;
data_
.
push_back
(
argu
);
}
/**
* @brief Append user defined data
* @param[in] ptr user defined data
*/
void
appendUserDefinedPtr
(
UserDefinedVectorPtr
ptr
)
{
Argument
argu
;
argu
.
udp
=
ptr
;
data_
.
push_back
(
argu
);
}
/*
* @brief Append argument
...
...
paddle/parameter/Argument.cpp
浏览文件 @
b2f72768
...
...
@@ -123,46 +123,6 @@ static void resizeAndCopy(ICpuGpuVectorPtr& dest,
}
}
static
void
resizeAndCopy
(
UserDefinedVectorPtr
&
dest
,
const
UserDefinedVectorPtr
&
src
,
bool
useGpu
,
hl_stream_t
stream
)
{
if
(
src
)
{
CHECK
(
!
useGpu
)
<<
"not implemented"
;
size_t
height
=
src
->
size
();
if
(
!
dest
)
{
dest
=
std
::
make_shared
<
std
::
vector
<
void
*>>
(
height
);
}
else
{
dest
->
resize
(
height
);
}
std
::
copy_n
(
src
->
begin
(),
height
,
dest
->
begin
());
}
else
{
dest
.
reset
();
}
}
static
void
resizeAndCopy
(
UserDefinedVectorPtr
&
dest
,
const
UserDefinedVectorPtr
&
src
,
int32_t
startPos
,
int32_t
copySize
,
bool
useGpu
,
hl_stream_t
stream
=
HPPL_STREAM_DEFAULT
)
{
if
(
src
)
{
CHECK
(
!
useGpu
)
<<
"not implemented"
;
CHECK_LE
((
size_t
)
startPos
+
copySize
,
src
->
size
());
size_t
height
=
copySize
;
if
(
!
dest
)
{
dest
=
std
::
make_shared
<
std
::
vector
<
void
*>>
(
height
);
}
else
{
dest
->
resize
(
height
);
}
std
::
copy_n
(
src
->
begin
()
+
startPos
,
height
,
dest
->
begin
());
}
else
{
dest
.
reset
();
}
}
static
void
resizeAndCopy
(
SVectorPtr
&
dest
,
const
SVectorPtr
&
src
,
bool
useGpu
,
...
...
@@ -223,7 +183,6 @@ void Argument::resizeAndCopyFrom(const Argument& src,
false
/* useGpu */
,
stream
);
}
resizeAndCopy
(
udp
,
src
.
udp
,
useGpu
,
stream
);
resizeAndCopy
(
strs
,
src
.
strs
,
useGpu
,
stream
);
frameWidth
=
src
.
frameWidth
;
frameHeight
=
src
.
frameHeight
;
...
...
@@ -255,7 +214,6 @@ int32_t Argument::resizeAndCopyFrom(const Argument& src,
resizeAndCopy
(
value
,
src
.
value
,
startRow
,
copySize
,
useGpu
,
stream
);
resizeAndCopy
(
grad
,
src
.
grad
,
startRow
,
copySize
,
useGpu
,
stream
);
resizeAndCopy
(
ids
,
src
.
ids
,
startRow
,
copySize
,
useGpu
,
stream
);
resizeAndCopy
(
udp
,
src
.
udp
,
startRow
,
copySize
,
useGpu
,
stream
);
resizeAndCopy
(
strs
,
src
.
strs
,
startRow
,
copySize
,
useGpu
,
stream
);
return
copySize
;
}
else
{
...
...
@@ -268,7 +226,6 @@ int32_t Argument::resizeAndCopyFrom(const Argument& src,
resizeAndCopy
(
value
,
src
.
value
,
startRow
,
copyFeatureSize
,
useGpu
,
stream
);
resizeAndCopy
(
grad
,
src
.
grad
,
startRow
,
copyFeatureSize
,
useGpu
,
stream
);
resizeAndCopy
(
ids
,
src
.
ids
,
startRow
,
copyFeatureSize
,
useGpu
,
stream
);
resizeAndCopy
(
udp
,
src
.
udp
,
startRow
,
copySize
,
useGpu
,
stream
);
resizeAndCopy
(
sequenceStartPositions
,
src
.
sequenceStartPositions
,
startSeq
,
...
...
paddle/parameter/Argument.h
浏览文件 @
b2f72768
...
...
@@ -24,8 +24,6 @@ limitations under the License. */
namespace
paddle
{
// vector of user defined pointers
typedef
std
::
shared_ptr
<
std
::
vector
<
void
*>>
UserDefinedVectorPtr
;
typedef
std
::
shared_ptr
<
std
::
vector
<
std
::
string
>>
SVectorPtr
;
struct
Argument
{
...
...
@@ -40,7 +38,6 @@ struct Argument {
sequenceStartPositions
(
nullptr
),
subSequenceStartPositions
(
nullptr
),
cpuSequenceDims
(
nullptr
),
udp
(
nullptr
),
deviceId
(
-
1
),
allCount
(
0
),
valueCount
(
0
),
...
...
@@ -63,7 +60,6 @@ struct Argument {
sequenceStartPositions
=
argument
.
sequenceStartPositions
;
subSequenceStartPositions
=
argument
.
subSequenceStartPositions
;
cpuSequenceDims
=
argument
.
cpuSequenceDims
;
udp
=
argument
.
udp
;
deviceId
=
argument
.
deviceId
;
allCount
=
argument
.
allCount
;
frameHeight
=
argument
.
frameHeight
;
...
...
@@ -96,8 +92,6 @@ struct Argument {
// dimension of sequence, stored only in CPU
IVectorPtr
cpuSequenceDims
;
UserDefinedVectorPtr
udp
;
// user defined pointer
int
deviceId
;
// the GPU device id which the argument in
int
allCount
;
// the number of output layers using this argument
mutable
int
valueCount
;
// waiting this member when layer do forward
...
...
@@ -137,7 +131,6 @@ struct Argument {
if
(
ids
)
return
ids
->
getSize
();
if
(
grad
)
return
grad
->
getHeight
();
if
(
in
)
return
in
->
getHeight
();
if
(
udp
)
return
udp
->
size
();
if
(
strs
)
return
strs
->
size
();
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录