!4363 export and load model for serving

Merge pull request !4363 from hexia/export_and_load_model_for_serving
pull/4363/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit 72f77bdea7

File diff suppressed because it is too large Load Diff

@ -57,7 +57,7 @@ int AnfConverter::ValidateFileStr(const std::string &modelFile, std::string file
bool AnfConverter::ReadOnnxFromBinary(const std::string &modelFile, google::protobuf::Message *onnx_model) {
std::unique_ptr<char> onnx_file(new (std::nothrow) char[PATH_MAX]{0});
int fd = open(onnx_file.get(), O_RDONLY);
int fd = open(modelFile.c_str(), O_RDONLY);
if (fd < 0) {
MS_LOG(EXCEPTION) << "failed to open file";
}

File diff suppressed because it is too large Load Diff

@ -52,18 +52,17 @@ class MSANFModelParser {
bool GetAttrValueForCNode(const PrimitivePtr &prim, const onnx::AttributeProto &attr_proto);
bool ObtainCNodeAttrInTypeForm(const PrimitivePtr &prim, const std::string &attr_name,
const onnx::TensorProto &attr_tensor);
bool ObtainCNodeAttrInScalarForm(const PrimitivePtr &prim, const std::string &attr_name,
const onnx::TensorProto &attr_tensor);
ValuePtr ObtainCNodeAttrInScalarForm(const onnx::TensorProto &attr_tensor);
bool ObtainCNodeAttrInTensorForm(const PrimitivePtr &prim, const std::string &attr_name,
const onnx::TensorProto &attr_tensor);
bool BuildValueNodeForFuncGraph(const onnx::NodeProto &node_proto);
bool ObtainValueNodeInTensorForm(const string &value_node_name, const onnx::TensorProto &attr_tensor);
bool ObtainValueNodeInScalarForm(const string &value_node_name, const onnx::TensorProto &attr_tensor);
bool GetAttrValueForValueNode(const string &ref_attr_name, const std::string &value_node_name,
const onnx::TensorProto &attr_tensor);
bool GetAttrValueForValueNode(const std::string &value_node_name, const onnx::AttributeProto &attr_tensor);
bool ObtainValueNodeInTypeForm(const string &value_node_name, const onnx::TensorProto &attr_tensor);
AbstractBasePtr GetAbstractForCNode(const onnx::AttributeProto &attr_proto);
std::unordered_map<std::string, abstract::AbstractBasePtr> GetAbstractForCNode(
const onnx::AttributeProto &attr_proto);
std::string producer_name_;
int model_version_;

Loading…
Cancel
Save