From f71f11e7e970a371aa3a44944f38641656bc92de Mon Sep 17 00:00:00 2001 From: Abhinav Arora Date: Wed, 14 Feb 2018 13:18:16 -0800 Subject: [PATCH] Fix fill_op.cc --- paddle/fluid/operators/fill_op.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/fill_op.cc b/paddle/fluid/operators/fill_op.cc index c505c739d4..69b209eab4 100644 --- a/paddle/fluid/operators/fill_op.cc +++ b/paddle/fluid/operators/fill_op.cc @@ -51,7 +51,8 @@ class FillOp : public framework::OperatorBase { "Cannot find variable %s", Output("Out")) .GetMutable()); out.Resize(framework::make_ddim(Attr>("shape"))); - auto dtype = static_cast(Attr("dtype")); + auto dtype = + static_cast(Attr("dtype")); platform::CPUPlace cpu; auto force_cpu = Attr("force_cpu"); out.mutable_data(force_cpu ? cpu : place, framework::ToTypeIndex(dtype)); @@ -93,7 +94,7 @@ Fill an tensor with `value` and `shape`. The type of the tensor is specify by "value", "The float values of tensor, which are flatten in row major"); AddAttr>("shape", "The shape of output tensor"); AddAttr("dtype", "The data type of output tensor, Default is float") - .SetDefault(framework::proto::DataType::FP32); + .SetDefault(framework::proto::VarType::FP32); AddAttr("force_cpu", "Whether the output tensor must be at CPU memory or not. " "Default is false.") -- GitLab