Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
3ec48480
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看板
提交
3ec48480
编写于
9月 20, 2017
作者:
D
dangqingqing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix bug
上级
39cf2e21
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
14 addition
and
4 deletion
+14
-4
paddle/operators/accuracy_op.cc
paddle/operators/accuracy_op.cc
+3
-3
paddle/operators/dropout_op.cc
paddle/operators/dropout_op.cc
+1
-0
paddle/operators/fc_op.cc
paddle/operators/fc_op.cc
+0
-1
paddle/operators/pad_op.cc
paddle/operators/pad_op.cc
+5
-0
paddle/operators/reshape_op.cc
paddle/operators/reshape_op.cc
+5
-0
未找到文件。
paddle/operators/accuracy_op.cc
浏览文件 @
3ec48480
...
@@ -55,15 +55,15 @@ class AccuracyOpMaker : public framework::OpProtoAndCheckerMaker {
...
@@ -55,15 +55,15 @@ class AccuracyOpMaker : public framework::OpProtoAndCheckerMaker {
// TODO(typhoonzero): AddInput("Weight", ...
// TODO(typhoonzero): AddInput("Weight", ...
AddOutput
(
"Accuracy"
,
"The accuracy of current batch"
);
AddOutput
(
"Accuracy"
,
"The accuracy of current batch"
);
AddComment
(
AddComment
(
R"DOC(
R
"DOC(
Accuracy. It will print accuracy rate for classification.
Accuracy. It will print accuracy rate for classification.
The accuracy is:
The accuracy is:
.. math::
.. math::
accuracy = \\frac{NumOfCorrectPredicts}{NumOfAllSamples})
accuracy = \\frac{NumOfCorrectPredicts}{NumOfAllSamples})
Both the input `Inference` and `Label` can carry the LoD (Level of Details)
Both the input `Inference` and `Label` can carry the LoD (Level of Details)
information, or not. But the output only shares the LoD with input `Inference`.
information, or not. But the output only shares the LoD with input `Inference`.
DOC"
);
)
DOC"
);
}
}
};
};
...
...
paddle/operators/dropout_op.cc
浏览文件 @
3ec48480
...
@@ -38,6 +38,7 @@ class DropoutOp : public framework::OperatorWithKernel {
...
@@ -38,6 +38,7 @@ class DropoutOp : public framework::OperatorWithKernel {
if
(
ctx
.
Attr
<
int
>
(
"is_training"
)
==
1
)
{
if
(
ctx
.
Attr
<
int
>
(
"is_training"
)
==
1
)
{
ctx
.
Output
<
LoDTensor
>
(
"Mask"
)
->
Resize
(
dims
);
ctx
.
Output
<
LoDTensor
>
(
"Mask"
)
->
Resize
(
dims
);
}
}
ctx
.
ShareLoD
(
"X"
,
"Out"
);
}
}
};
};
...
...
paddle/operators/fc_op.cc
浏览文件 @
3ec48480
...
@@ -189,7 +189,6 @@ Activation type can be set to `identity` (default), `sigmoid` or `softmax`.
...
@@ -189,7 +189,6 @@ Activation type can be set to `identity` (default), `sigmoid` or `softmax`.
All the inputs can carry the LoD (Level of Details) information,
All the inputs can carry the LoD (Level of Details) information,
or not. But the output only shares the LoD with first input (`X[0]`).
or not. But the output only shares the LoD with first input (`X[0]`).
)DOC"
);
)DOC"
);
)DOC"
);
}
}
};
};
...
...
paddle/operators/pad_op.cc
浏览文件 @
3ec48480
...
@@ -41,6 +41,11 @@ class PadOp : public framework::OperatorWithKernel {
...
@@ -41,6 +41,11 @@ class PadOp : public framework::OperatorWithKernel {
}
}
ctx
.
Output
<
framework
::
LoDTensor
>
(
"Out"
)
->
Resize
(
ctx
.
Output
<
framework
::
LoDTensor
>
(
"Out"
)
->
Resize
(
framework
::
make_ddim
(
out_dims
));
framework
::
make_ddim
(
out_dims
));
if
(
out_dims
[
0
]
==
x_dim
[
0
])
{
// Only pass LoD when the first dimension is equal between
// output and input.
ctx
.
ShareLoD
(
"X"
,
"Out"
);
}
}
}
};
};
...
...
paddle/operators/reshape_op.cc
浏览文件 @
3ec48480
...
@@ -51,6 +51,11 @@ class ReshapeOp : public framework::OperatorWithKernel {
...
@@ -51,6 +51,11 @@ class ReshapeOp : public framework::OperatorWithKernel {
[](
int
a
)
{
return
static_cast
<
int64_t
>
(
a
);
});
[](
int
a
)
{
return
static_cast
<
int64_t
>
(
a
);
});
auto
out_dims
=
framework
::
make_ddim
(
shape_int64
);
auto
out_dims
=
framework
::
make_ddim
(
shape_int64
);
ctx
.
Output
<
framework
::
LoDTensor
>
(
"Out"
)
->
Resize
(
out_dims
);
ctx
.
Output
<
framework
::
LoDTensor
>
(
"Out"
)
->
Resize
(
out_dims
);
if
(
shape
[
0
]
==
in
->
dims
()[
0
])
{
// Only pass LoD when the first dimension is equal between
// output and input.
ctx
.
ShareLoD
(
"X"
,
"Out"
);
}
}
}
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录