Skip to content

Commit e4c2405

Browse files
committed
Update to use new API OpAttr_GetTensorAttributeAsOrtValue
1 parent 0a8be0d commit e4c2405

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

plugin_execution_providers/tensorrt/utils/ort_graph_to_proto.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
#define INCLUDE_ONNXRUNTIME_CORE_PROVIDERS_UTILS_ORT_GRAPH_TO_PROTO_H_
123123

124124
#include <functional>
125-
#include "onnxruntime_cxx_api.h"
125+
#include "core/session/onnxruntime_cxx_api.h"
126126
#include "onnx/onnx_pb.h"
127127

128128
namespace OrtEpUtils {
@@ -232,7 +232,7 @@ static Ort::Status GetOrtValueInfoTensorTypeShape(const OrtValueInfo& ort_value_
232232
/*out*/ std::vector<int64_t>& dims,
233233
/*out*/ std::vector<std::string>& symbolic_dims);
234234
static Ort::Status OrtValueInfoToProto(const OrtValueInfo& ort_value_info, onnx::ValueInfoProto& value_info_proto);
235-
static Ort::Status OrtOpAttrToProto(const OrtNode& ort_node, const OrtOpAttr& ort_attr, onnx::AttributeProto& attr_proto);
235+
static Ort::Status OrtOpAttrToProto(const OrtOpAttr& ort_attr, onnx::AttributeProto& attr_proto);
236236

237237
Ort::Status OrtGraphToProto(const OrtGraph& ort_graph,
238238
onnx::GraphProto& graph_proto,
@@ -379,7 +379,7 @@ Ort::Status OrtGraphToProto(const OrtGraph& ort_graph,
379379
}
380380

381381
onnx::AttributeProto* attr_proto = node_proto->add_attribute();
382-
ORT_EP_UTILS_CXX_RETURN_IF_ERROR(OrtOpAttrToProto(*ort_node, *ort_attr, *attr_proto));
382+
ORT_EP_UTILS_CXX_RETURN_IF_ERROR(OrtOpAttrToProto(*ort_attr, *attr_proto));
383383
}
384384
}
385385

@@ -652,7 +652,7 @@ static Ort::Status OrtValueInfoToProto(const OrtValueInfo& ort_value_info,
652652
return Ort::Status{nullptr};
653653
}
654654

655-
static Ort::Status OrtOpAttrToProto(const OrtNode& ort_node, const OrtOpAttr& ort_attr, onnx::AttributeProto& attr_proto) {
655+
static Ort::Status OrtOpAttrToProto(const OrtOpAttr& ort_attr, onnx::AttributeProto& attr_proto) {
656656
const OrtApi& ort_api = Ort::GetApi();
657657

658658
const char* attr_name = nullptr;
@@ -766,7 +766,7 @@ static Ort::Status OrtOpAttrToProto(const OrtNode& ort_node, const OrtOpAttr& or
766766
// TensorProto as an attribute value doesn't require a name.
767767

768768
OrtValue* ort_value = nullptr;
769-
ORT_EP_UTILS_C_RETURN_IF_ERROR(ort_api.Node_GetTensorAttributeAsOrtValue(&ort_node, &ort_attr, &ort_value));
769+
ORT_EP_UTILS_C_RETURN_IF_ERROR(ort_api.OpAttr_GetTensorAttributeAsOrtValue(&ort_attr, &ort_value));
770770

771771
Ort::Value tensor(ort_value);
772772

0 commit comments

Comments
 (0)