diff --git a/paddle/optimizer/serialization.h b/paddle/optimizer/serialization.h index 18088991754096abd0bed1c2c5b77bf854be38fa..60bb7e2765156e29f12fce14baef8aae0d2bb762 100644 --- a/paddle/optimizer/serialization.h +++ b/paddle/optimizer/serialization.h @@ -10,7 +10,7 @@ namespace paddle { namespace optimizer { -inline unsigned CalStateSize(int* state_len) { return 0; } +static unsigned CalStateSize(int* state_len) { return 0; } template unsigned CalStateSize(const HEAD& head, const TAIL&... tail) { @@ -23,7 +23,6 @@ unsigned CalStateSize(const HEAD& head, const TAIL&... tail) { static void TensorToProto(const Tensor& tensor, TensorProto* proto) { proto->set_data_type(TensorProto::PADDLE_ELEMENT_TYPE_FLOAT32); - proto->set_size(tensor.size()); std::stringstream os; for (size_t i = 0; i < tensor.size(); ++i) { os << tensor[i];