Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
07d16e3e
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看板
提交
07d16e3e
编写于
8月 17, 2017
作者:
T
tensor-tang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine comments
上级
635b8672
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
11 deletion
+19
-11
paddle/gserver/tests/MKLDNNTester.cpp
paddle/gserver/tests/MKLDNNTester.cpp
+4
-4
paddle/parameter/Parameter.h
paddle/parameter/Parameter.h
+15
-7
未找到文件。
paddle/gserver/tests/MKLDNNTester.cpp
浏览文件 @
07d16e3e
...
@@ -345,10 +345,10 @@ void MKLDNNTester::run(const TestConfig& dnn,
...
@@ -345,10 +345,10 @@ void MKLDNNTester::run(const TestConfig& dnn,
return
;
return
;
}
}
// After run some iters, the mkldnn weight has been stored in dnnLayer
// After run some iter
ation
s, the mkldnn weight has been stored in dnnLayer
// and we can also get the mkldnn weight param
ter header format
// and we can also get the mkldnn weight param
eter header format.
// Weight param should always be index 0 (and bias index 1).
// Weight param
eter
should always be index 0 (and bias index 1).
// TODO(TJ): should also consider
ate
mean and var format when batchnorm ready
// TODO(TJ): should also consider mean and var format when batchnorm ready
int
dnnWgtFmt
=
parameters_
[
DNN
][
0
]
->
getHeaderFormat
();
int
dnnWgtFmt
=
parameters_
[
DNN
][
0
]
->
getHeaderFormat
();
int
refWgtFmt
=
parameters_
[
REF
][
0
]
->
getHeaderFormat
();
int
refWgtFmt
=
parameters_
[
REF
][
0
]
->
getHeaderFormat
();
if
(
dnnWgtFmt
==
refWgtFmt
)
{
if
(
dnnWgtFmt
==
refWgtFmt
)
{
...
...
paddle/parameter/Parameter.h
浏览文件 @
07d16e3e
...
@@ -35,9 +35,17 @@ limitations under the License. */
...
@@ -35,9 +35,17 @@ limitations under the License. */
namespace
paddle
{
namespace
paddle
{
typedef
enum
{
typedef
enum
{
PARAM_FORMAT_ORIGINAL
=
0
,
// the paddle original basic format
/// The paddle original basic format
PARAM_FORMAT_MKLDNN_OI
,
// the mkldnn format oi
PARAM_FORMAT_ORIGINAL
=
0
,
PARAM_FORMAT_ITEMS
,
// the total format items numbers
/// See mkldnn_memory_format_t in
/// https://github.com/01org/mkl-dnn/blob/master/include/mkldnn_types.h
/// for a detailed description.
/// 2D weights tensor in the format (output channels, input channels).
PARAM_FORMAT_MKLDNN_OI
,
/// The total format items numbers
PARAM_FORMAT_ITEMS
,
}
PARAM_FORMAT
;
}
PARAM_FORMAT
;
class
SparsePrefetchRowCpuMatrix
;
class
SparsePrefetchRowCpuMatrix
;
...
@@ -256,19 +264,19 @@ public:
...
@@ -256,19 +264,19 @@ public:
};
};
/**
/**
* @brief Is the header
supported
* @brief Is the header
format supported.
*/
*/
static
bool
isHeaderFormatSupported
(
int32_t
fmt
)
{
static
bool
isHeaderFormatSupported
(
int32_t
fmt
)
{
return
fmt
<
PARAM_FORMAT_ITEMS
;
return
fmt
<
PARAM_FORMAT_ITEMS
;
}
}
/**
/**
* @brief Get the format in header
* @brief Get the format in header
.
*/
*/
int
getHeaderFormat
()
{
return
headerFormat_
;
}
int
getHeaderFormat
()
{
return
headerFormat_
;
}
/**
/**
* @brief Set the format in header
* @brief Set the format in header
.
*/
*/
void
setHeaderFormat
(
int32_t
fmt
)
{
headerFormat_
=
fmt
;
}
void
setHeaderFormat
(
int32_t
fmt
)
{
headerFormat_
=
fmt
;
}
...
@@ -343,7 +351,7 @@ protected:
...
@@ -343,7 +351,7 @@ protected:
bool
updated_
;
bool
updated_
;
SparseFormat
format_
;
SparseFormat
format_
;
// The header format for saving or loading param
//
/
The header format for saving or loading param
int32_t
headerFormat_
;
int32_t
headerFormat_
;
std
::
vector
<
std
::
shared_ptr
<
IParameterUpdaterHook
>>
updaterHooks_
;
std
::
vector
<
std
::
shared_ptr
<
IParameterUpdaterHook
>>
updaterHooks_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录