| @@ -44,16 +44,16 @@ Status Message2Operator::ParseOperatorAttrs(const google::protobuf::Message *mes | |||||
| for (auto &field : field_desc) { | for (auto &field : field_desc) { | ||||
| GE_CHECK_NOTNULL(field); | GE_CHECK_NOTNULL(field); | ||||
| if (field->is_repeated()) { | if (field->is_repeated()) { | ||||
| std::cout << "1111" << endl, | |||||
| std::cout << "1111" << std::endl, | |||||
| if (ParseRepeatedField(reflection, message, field, ops) != SUCCESS) { | if (ParseRepeatedField(reflection, message, field, ops) != SUCCESS) { | ||||
| std::cout << "[Parse][RepeatedField]" << field->name().c_str() << "failed." << endl, | |||||
| std::cout << "[Parse][RepeatedField]" << field->name().c_str() << "failed." << std::endl, | |||||
| GELOGE(FAILED, "[Parse][RepeatedField] %s failed.", field->name().c_str()); | GELOGE(FAILED, "[Parse][RepeatedField] %s failed.", field->name().c_str()); | ||||
| return FAILED; | return FAILED; | ||||
| } | } | ||||
| } else { | } else { | ||||
| std::cout << "2222" << endl, | |||||
| std::cout << "2222" << std::endl, | |||||
| if (ParseField(reflection, message, field, depth, ops) != SUCCESS) { | if (ParseField(reflection, message, field, depth, ops) != SUCCESS) { | ||||
| std::cout << "[Parse][Field]" << field->name().c_str() << "failed." << endl, | |||||
| std::cout << "[Parse][Field]" << field->name().c_str() << "failed." << std::endl, | |||||
| GELOGE(FAILED, "[Parse][Field] %s failed.", field->name().c_str()); | GELOGE(FAILED, "[Parse][Field] %s failed.", field->name().c_str()); | ||||
| return FAILED; | return FAILED; | ||||
| } | } | ||||
| @@ -65,7 +65,7 @@ Status Message2Operator::ParseOperatorAttrs(const google::protobuf::Message *mes | |||||
| Status Message2Operator::ParseBaseTypeField(const google::protobuf::Reflection *reflection, | Status Message2Operator::ParseBaseTypeField(const google::protobuf::Reflection *reflection, | ||||
| const google::protobuf::Message *message, | const google::protobuf::Message *message, | ||||
| const google::protobuf::FieldDescriptor *field, ge::Operator &ops) { | const google::protobuf::FieldDescriptor *field, ge::Operator &ops) { | ||||
| std::cout << "weewf" << endl; | |||||
| std::cout << "weewf" << std::endl; | |||||
| switch (field->cpp_type()) { | switch (field->cpp_type()) { | ||||
| case google::protobuf::FieldDescriptor::CPPTYPE_INT32: { | case google::protobuf::FieldDescriptor::CPPTYPE_INT32: { | ||||
| int32_t value = reflection->GetInt32(*message, field); | int32_t value = reflection->GetInt32(*message, field); | ||||
| @@ -74,14 +74,14 @@ Status Message2Operator::ParseBaseTypeField(const google::protobuf::Reflection * | |||||
| break; | break; | ||||
| } | } | ||||
| case google::protobuf::FieldDescriptor::CPPTYPE_UINT32: { | case google::protobuf::FieldDescriptor::CPPTYPE_UINT32: { | ||||
| std::cout << "weCPPTYPE_UINT32ewf" << endl; | |||||
| std::cout << "weCPPTYPE_UINT32ewf" << std::endl; | |||||
| uint32_t value = reflection->GetUInt32(*message, field); | uint32_t value = reflection->GetUInt32(*message, field); | ||||
| GELOGD("Parse result(%s : %u)", field->name().c_str(), value); | GELOGD("Parse result(%s : %u)", field->name().c_str(), value); | ||||
| (void)ops.SetAttr(field->name().c_str(), value); | (void)ops.SetAttr(field->name().c_str(), value); | ||||
| break; | break; | ||||
| } | } | ||||
| case google::protobuf::FieldDescriptor::CPPTYPE_INT64: { | case google::protobuf::FieldDescriptor::CPPTYPE_INT64: { | ||||
| std::cout << "CPPTYPE_INT64" << endl; | |||||
| std::cout << "CPPTYPE_INT64" << std::endl; | |||||
| int64_t value = reflection->GetInt64(*message, field); | int64_t value = reflection->GetInt64(*message, field); | ||||
| GELOGD("Parse result(%s : %ld)", field->name().c_str(), value); | GELOGD("Parse result(%s : %ld)", field->name().c_str(), value); | ||||
| (void)ops.SetAttr(field->name().c_str(), value); | (void)ops.SetAttr(field->name().c_str(), value); | ||||
| @@ -179,7 +179,7 @@ Status Message2Operator::ParseRepeatedBaseTypeField(const google::protobuf::Refl | |||||
| break; | break; | ||||
| } | } | ||||
| case google::protobuf::FieldDescriptor::CPPTYPE_FLOAT: { | case google::protobuf::FieldDescriptor::CPPTYPE_FLOAT: { | ||||
| std::cout << "sdfsfCPPTYPE_FLOAT" << endl; | |||||
| std::cout << "sdfsfCPPTYPE_FLOAT" << std::endl; | |||||
| std::vector<float> attr_value; | std::vector<float> attr_value; | ||||
| for (int i = 0; i < field_size; i++) { | for (int i = 0; i < field_size; i++) { | ||||
| float value = reflection->GetRepeatedFloat(*message, field, i); | float value = reflection->GetRepeatedFloat(*message, field, i); | ||||