mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-17 21:10:43 +00:00
* Dynamic onnx model fusion * empty node names shoudl remain empty * comments and cleanup * logic reversed for promoting_unlined_outputs * PR feedback * type * typo * fix model outputs with promote unlinked output * remove disembodied model Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
33 lines
1 KiB
C++
33 lines
1 KiB
C++
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
#pragma once
|
|
|
|
#include "winml_adapter_c_api.h"
|
|
#include <memory>
|
|
#include "core/graph/onnx_protobuf.h"
|
|
|
|
class ModelInfo;
|
|
|
|
struct OrtModel {
|
|
public:
|
|
static OrtStatus* CreateEmptyModel(int64_t opset, OrtModel** model);
|
|
static OrtStatus* CreateOrtModelFromPath(const char* path, size_t len, OrtModel** model);
|
|
static OrtStatus* CreateOrtModelFromData(void* data, size_t len, OrtModel** model);
|
|
static OrtStatus* CreateOrtModelFromProto(std::unique_ptr<onnx::ModelProto>&& model_proto, OrtModel** model);
|
|
const ModelInfo* UseModelInfo() const;
|
|
|
|
onnx::ModelProto* UseModelProto() const;
|
|
std::unique_ptr<onnx::ModelProto> DetachModelProto();
|
|
|
|
void RefreshModelInfo();
|
|
|
|
private:
|
|
OrtModel(std::unique_ptr<onnx::ModelProto> model_proto);
|
|
OrtModel(const OrtModel& other) = delete;
|
|
OrtModel& operator=(const OrtModel& other) = delete;
|
|
|
|
private:
|
|
std::unique_ptr<onnx::ModelProto> model_proto_;
|
|
std::unique_ptr<ModelInfo> model_info_;
|
|
};
|