Onnxruntime: KernelInfoGetAttribute doesn't support returning vector of string/float/int64_t

Created on 13 Oct 2020  路  5Comments  路  Source: microsoft/onnxruntime

Is your feature request related to a problem? Please describe.
I want to use KernelInfoGetAttribute funtion to get attributes from onnx model, but current KernelInfoGetAttribute only support return string/float/int64_t, what I want to get is vector of string/float/int64_t.

//onnxruntime/include/onnxruntime/core/session/onnxruntime_c_api.h
ORT_API2_STATUS(KernelInfoGetAttribute_float, _In_ const OrtKernelInfo* info, _In_ const char* name,
                  _Out_ float* out);
ORT_API2_STATUS(KernelInfoGetAttribute_int64, _In_ const OrtKernelInfo* info, _In_ const char* name,
                  _Out_ int64_t* out);
ORT_API2_STATUS(KernelInfoGetAttribute_string, _In_ const OrtKernelInfo* info, _In_ const char* name, _Out_ char* out,
                  _Inout_ size_t* size);

System information

  • ONNX Runtime version (you are using): v1.5.1

Additional context
attributes type is vector of string/float/int64_t is very common, for example Conv, its dilations, kernel_shape, pads and strides could usually be vector of int64_t, so you really should support this feature.

coreruntime enhancement support

All 5 comments

I'm thinking, usually the data of attribute info is small, can we open an interface that directly pass the serialized AttributeProto protobuf to the user? Then it will support any data type ONNX needs. I believe in most of the cases the performance of parsing an AttributeProto isn't a concern.

@snnn open an interface to get attribute info is more important, but now customer op can only get attributes for single data, some time it's not working

@pranavsharma what do you think?

@pranavsharma

@pranavsharma

We'll discuss and get back to you next week.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shixinlishixinli picture shixinlishixinli  路  6Comments

fdwr picture fdwr  路  5Comments

diwakar-ravichandran picture diwakar-ravichandran  路  5Comments

Pavel-Konarik picture Pavel-Konarik  路  4Comments

dashesy picture dashesy  路  6Comments