Overview
RuntimeAttrs is an operator attribute access class, which provides the capability of accessing attributes during operator execution. This class provides a series of methods that allow you to obtain attribute values of different types (such as int64_t, float, bool, string, and Tensor) based on the attribute index. In ExtendedKernelContext and its subclasses, you can call GetAttrs to obtain operator attributes. The return value contains only the attributes defined in the IR prototype.
Header Files to Be Included
1 | #include <runtime_attrs.h> |
Public Member Functions
RuntimeAttrs() = delete RuntimeAttrs(const RuntimeAttrs &) = delete RuntimeAttrs(RuntimeAttrs &&) = delete RuntimeAttrs &operator=(const RuntimeAttrs &) = delete RuntimeAttrs &operator=(RuntimeAttrs &&) = delete template<typename T> const T *GetAttrPointer(size_t index) const const int64_t *GetInt(const size_t index) const const TypedContinuousVector<int64_t> *GetListInt(const size_t index) const const ContinuousVectorVector *GetListListInt(const size_t index) const const char *GetStr(const size_t index) const const Tensor *GetTensor(const size_t index) const const float *GetFloat(const size_t index) const const bool *GetBool(const size_t index) const const TypedContinuousVector<float> *GetListFloat(const size_t index) const const ContinuousVectorVector *GetListListFloat(const size_t index) const size_t GetAttrNum() const
Parent topic: RuntimeAttrs