提交 d9f0e725 编写于 作者: L luotao1

refine with comments

test=develop
上级 6fa52f83
......@@ -119,11 +119,8 @@ void FCOpMaker::Make() {
AddAttr<bool>("use_mkldnn",
"(bool, default false) Only used in mkldnn kernel")
.SetDefault(false);
AddAttr<bool>(
framework::kAllKernelsMustComputeRuntimeShape,
"If an Op has this attribute, all its kernels should calculate output"
"variable's shape in the corresponding Compute() function. Note that "
"this temporal attribute would be deleted after all ops contain it.")
AddAttr<bool>(framework::kAllKernelsMustComputeRuntimeShape,
"Skip calling InferShape() function in the runtime.")
.SetDefault(true);
AddComment(R"DOC(
Fully Connected Operator.
......@@ -140,8 +137,8 @@ class FCOpKernel : public framework::OpKernel<T> {
PADDLE_ENFORCE(platform::is_cpu_place(ctx.GetPlace()),
"It must use CPUPlace.");
auto input = ctx.Input<framework::LoDTensor>("Input");
auto w = ctx.Input<framework::LoDTensor>("W");
auto bias = ctx.Input<framework::LoDTensor>("Bias");
auto w = ctx.Input<Tensor>("W");
auto bias = ctx.Input<Tensor>("Bias");
auto output = ctx.Output<framework::LoDTensor>("Out");
int in_num_col_dims = ctx.Attr<int>("in_num_col_dims");
auto w_dims = w->dims();
......
......@@ -88,11 +88,8 @@ class FusedEmbeddingSeqPoolOpMaker : public framework::OpProtoAndCheckerMaker {
"(boolean, default false) "
"Sparse update.")
.SetDefault(false);
AddAttr<bool>(
framework::kAllKernelsMustComputeRuntimeShape,
"If an Op has this attribute, all its kernels should calculate output"
"variable's shape in the corresponding Compute() function. Note that "
"this temporal attribute would be deleted after all ops contain it.")
AddAttr<bool>(framework::kAllKernelsMustComputeRuntimeShape,
"Skip calling InferShape() function in the runtime.")
.SetDefault(true);
AddComment(R"DOC(
FusedEmbeddingSeqPool Operator.
......
......@@ -54,11 +54,8 @@ $$Out = scale * X$$
)DOC");
AddAttr<int>("num_hash", "").SetDefault(1);
AddAttr<int>("mod_by", "").SetDefault(100000);
AddAttr<bool>(
framework::kAllKernelsMustComputeRuntimeShape,
"If an Op has this attribute, all its kernels should calculate output"
"variable's shape in the corresponding Compute() function. Note that "
"this temporal attribute would be deleted after all ops contain it.")
AddAttr<bool>(framework::kAllKernelsMustComputeRuntimeShape,
"Skip calling InferShape() function in the runtime.")
.SetDefault(true);
}
};
......
......@@ -124,8 +124,8 @@ class FCMKLDNNOpKernel : public paddle::framework::OpKernel<T> {
const auto& mkldnn_engine = dev_ctx.GetEngine();
auto input = ctx.Input<framework::LoDTensor>("Input");
auto w = ctx.Input<framework::LoDTensor>("W");
auto bias = ctx.Input<framework::LoDTensor>("Bias");
auto w = ctx.Input<Tensor>("W");
auto bias = ctx.Input<Tensor>("Bias");
PADDLE_ENFORCE(input->dims().size() == 2 || input->dims().size() == 4,
"Input must be with 2 or 4 dimensions, i.e. NCHW");
......
......@@ -59,11 +59,8 @@ class SequenceEnumerateOpMaker : public framework::OpProtoAndCheckerMaker {
});
AddAttr<int>("pad_value", "(int) The enumerate sequence padding value.")
.SetDefault(0);
AddAttr<bool>(
framework::kAllKernelsMustComputeRuntimeShape,
"If an Op has this attribute, all its kernels should calculate output"
"variable's shape in the corresponding Compute() function. Note that "
"this temporal attribute would be deleted after all ops contain it.")
AddAttr<bool>(framework::kAllKernelsMustComputeRuntimeShape,
"Skip calling InferShape() function in the runtime.")
.SetDefault(true);
AddComment(R"DOC(
Sequence Enumerate Operator.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册