提交 613d3ef0 编写于 作者: Y yuyang18

Fix compile error

上级 a0c41383
......@@ -53,7 +53,7 @@ class BatchSizeLikeOp : public framework::OperatorWithKernel {
class BatchSizeLikeOpMaker : public framework::OpProtoAndCheckerMaker {
public:
void Make() override {
void Make() final {
AddInput("Input",
"(Tensor) Tensor "
"whose input_dim_idx'th dimension specifies the batch_size");
......@@ -67,7 +67,11 @@ class BatchSizeLikeOpMaker : public framework::OpProtoAndCheckerMaker {
AddAttr<int>("output_dim_idx",
"(int, default 0) The index of output's batch size dimension")
.SetDefault(0);
Apply();
}
protected:
virtual void Apply() = 0;
};
} // namespace operators
......
......@@ -30,8 +30,8 @@ class FillConstantBatchSizeLikeOp : public BatchSizeLikeOp {
};
class FillConstantBatchSizeLikeOpMaker : public BatchSizeLikeOpMaker {
public:
void Make() override {
protected:
void Apply() override {
AddAttr<int>("dtype",
"(int, default 5 (FP32)) "
"Output data type")
......
......@@ -32,8 +32,8 @@ class GaussianRandomBatchSizeLikeOp : public BatchSizeLikeOp {
};
class GaussianRandomBatchSizeLikeOpMaker : public BatchSizeLikeOpMaker {
public:
void Make() override {
protected:
void Apply() override {
AddAttr<float>("mean",
"(float, default 0.0) "
"mean of random tensor.")
......
......@@ -32,8 +32,8 @@ class UniformRandomBatchSizeLikeOp : public BatchSizeLikeOp {
};
class UniformRandomBatchSizeLikeOpMaker : public BatchSizeLikeOpMaker {
public:
void Make() override {
protected:
void Apply() override {
AddComment(R"DOC(
Uniform random operator
......
......@@ -113,7 +113,7 @@ def generate_layer_fn(op_type):
if len(not_intermediate_outputs) != 1:
raise ValueError("Only one non intermediate output operator can be",
"automatically generated.")
"automatically generated. {0}".format(op_type))
if not_intermediate_outputs[0].duplicable:
raise ValueError(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册