HDK
|
#include <op_node_proto_helper.h>
Public Member Functions | |
OpNodeProtoHelper (const Impl_t *impl) | |
template<typename T > | |
Status | GetAttr (const std::string &name, T *value) const |
template<typename T > | |
T | GetAttr (const std::string &name) const |
template<typename T > | |
T | GetAttrOrDefault (const std::string &name, const T &default_value) const |
template<typename T > | |
void | GetAttrOrDefault (const std::string &name, T *value, const T &default_value) const |
template<typename T > | |
std::vector< T > | GetAttrsOrDefault (const std::string &name, const std::vector< T > &default_value={}) const |
template<typename T > | |
Status | GetAttrsAsSpan (const std::string &name, gsl::span< const T > &values) const |
Return a gsl::span that points to an array of primitive types held by AttributeProto This function allows to avoid copying big attributes locally into a kernel and operate on AttributeProto data directly. More... | |
Status | GetAttrs (const std::string &name, TensorShapeVector &out) const |
TensorShapeVector | GetAttrsOrDefault (const std::string &name, const TensorShapeVector &default_value={}) const |
template<typename T > | |
Status | GetAttrs (const std::string &name, std::vector< T > &values) const |
template<typename T > | |
Status | GetAttrs (const std::string &name, gsl::span< T > values) const |
Status | GetAttrsStringRefs (const std::string &name, std::vector< std::reference_wrapper< const std::string >> &refs) const |
uint32_t | GetPrimitiveAttrElementCount (ONNX_NAMESPACE::AttributeProto_AttributeType type, const std::string &name) const noexcept |
bool | HasPrimitiveAttribute (ONNX_NAMESPACE::AttributeProto_AttributeType type, const std::string &name) const noexcept |
uint32_t | GetInputCount () const |
uint32_t | GetOutputCount () const |
const ONNX_NAMESPACE::TypeProto * | GetInputType (size_t index) const |
const ONNX_NAMESPACE::TypeProto * | GetOutputType (size_t index) const |
const ONNX_NAMESPACE::AttributeProto * | TryGetAttribute (const std::string &name) const |
const ONNX_NAMESPACE::AttributeProto * | GetAttribute (const std::string &name) const |
A set of wrappers with common signatures for use with both OpKernelInfo (as its base class) and InferenceContext. Used by ABI kernels for both shape / type inference and kernel construction
Definition at line 23 of file op_node_proto_helper.h.
|
inlineexplicit |
Definition at line 25 of file op_node_proto_helper.h.
Status onnxruntime::OpNodeProtoHelper< Impl_t >::GetAttr | ( | const std::string & | name, |
T * | value | ||
) | const |
Get a single attribute Call this function for a required attribute or when a default value for an optional attribute is specified in the op schema
|
inline |
Get a single attribute Call this function for a required attribute or when a default value for an optional attribute is specified in the op schema Throws if an attribute with the specified type doesn't exist
Definition at line 40 of file op_node_proto_helper.h.
|
inline |
Definition at line 139 of file op_node_proto_helper.h.
|
inline |
Get a single attribute Call this function only when a default value for an optional attribute isn't specified in the op schema
Definition at line 51 of file op_node_proto_helper.h.
|
inline |
Get a single attribute Call this function only when a default value for an optional attribute isn't specified in the op schema
Definition at line 61 of file op_node_proto_helper.h.
Status onnxruntime::OpNodeProtoHelper< Impl_t >::GetAttrs | ( | const std::string & | name, |
TensorShapeVector & | out | ||
) | const |
Status onnxruntime::OpNodeProtoHelper< Impl_t >::GetAttrs | ( | const std::string & | name, |
std::vector< T > & | values | ||
) | const |
Get repeated attributes
Status onnxruntime::OpNodeProtoHelper< Impl_t >::GetAttrs | ( | const std::string & | name, |
gsl::span< T > | values | ||
) | const |
Status onnxruntime::OpNodeProtoHelper< Impl_t >::GetAttrsAsSpan | ( | const std::string & | name, |
gsl::span< const T > & | values | ||
) | const |
Return a gsl::span that points to an array of primitive types held by AttributeProto This function allows to avoid copying big attributes locally into a kernel and operate on AttributeProto data directly.
Does not apply to strings, Tensors and Sparse Tensors that require special treatment.
T | Primitive type contained in the array |
|
inline |
Get repeated attributes Call this function only when a default value for an optional attribute isn't specified in the op schema
Definition at line 71 of file op_node_proto_helper.h.
|
inline |
Definition at line 93 of file op_node_proto_helper.h.
Status onnxruntime::OpNodeProtoHelper< Impl_t >::GetAttrsStringRefs | ( | const std::string & | name, |
std::vector< std::reference_wrapper< const std::string >> & | refs | ||
) | const |
|
inline |
Definition at line 117 of file op_node_proto_helper.h.
|
inline |
Definition at line 125 of file op_node_proto_helper.h.
|
inline |
Definition at line 121 of file op_node_proto_helper.h.
|
inline |
Definition at line 129 of file op_node_proto_helper.h.
|
noexcept |
|
noexcept |
|
inline |
Definition at line 135 of file op_node_proto_helper.h.