From f78d7591d27a1c5712a4a6e116e6de8d52e62a0d Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Wed, 27 Sep 2017 20:15:59 -0700 Subject: [PATCH] Fix compile bug --- paddle/framework/var_desc.cc | 4 ++-- paddle/framework/var_desc.h | 2 +- paddle/pybind/protobuf.cc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/paddle/framework/var_desc.cc b/paddle/framework/var_desc.cc index 1ccb81879..13b9c5f3c 100644 --- a/paddle/framework/var_desc.cc +++ b/paddle/framework/var_desc.cc @@ -21,7 +21,7 @@ void VarDescBind::SetShape(const std::vector &dims) { VectorToRepeated(dims, desc_.mutable_lod_tensor()->mutable_dims()); } -void VarDescBind::SetDataType(enum DataType data_type) { +void VarDescBind::SetDataType(DataType data_type) { desc_.mutable_lod_tensor()->set_data_type(data_type); } @@ -29,7 +29,7 @@ std::vector VarDescBind::Shape() const { return RepeatedToVector(desc_.lod_tensor().dims()); } -DataType VarDescBind::DataType() const { +DataType VarDescBind::GetDataType() const { return desc_.lod_tensor().data_type(); } } // namespace framework diff --git a/paddle/framework/var_desc.h b/paddle/framework/var_desc.h index 6384da909..4763bf09d 100644 --- a/paddle/framework/var_desc.h +++ b/paddle/framework/var_desc.h @@ -64,7 +64,7 @@ class VarDescBind { std::vector Shape() const; - DataType DataType() const; + DataType GetDataType() const; private: VarDesc desc_; diff --git a/paddle/pybind/protobuf.cc b/paddle/pybind/protobuf.cc index 19ea26897..218821b35 100644 --- a/paddle/pybind/protobuf.cc +++ b/paddle/pybind/protobuf.cc @@ -167,7 +167,7 @@ void BindVarDsec(py::module &m) { .def("set_shape", &VarDescBind::SetShape) .def("set_data_type", &VarDescBind::SetDataType) .def("shape", &VarDescBind::Shape, py::return_value_policy::reference) - .def("data_type", &VarDescBind::DataType); + .def("data_type", &VarDescBind::GetDataType); } void BindOpDesc(py::module &m) { -- GitLab