SetAttr
Function Prototype
Operator& SetAttr(const string& name, AttrValue&& attrValue);
Operator& SetAttr(const string& name, const UsrQuantizeFactorParams& attrValue);
Function Description
Sets the attribute value of an operator.
Parameter Description
Parameter |
Input/Output |
Type |
Description |
---|---|---|---|
name |
Input |
const string& |
Attribute name |
attrValue |
Input |
AttrValue&& |
Attribute value to be set |
attrValue |
Input |
const UsrQuantizeFactorParams& |
Quantization factor For details about UsrQuantizeFactorParams, see Data Type Description. |
Return Value
Parameter |
Type |
Description |
---|---|---|
- |
Operator& |
Object itself |
Exception Handling
None
Restriction
None
Data Type Description
- Struct UsrQuantizeFactorParams
struct UsrQuantizeFactorParams { uint32_t quantize_algo{0}; uint32_t scale_type{0}; UsrQuantizeFactor quantize_param; UsrQuantizeFactor dequantize_param; UsrQuantizeFactor requantize_param; UsrQuantizeCalcFactor quantizecalc_param; };
- Struct UsrQuantizeFactor
struct UsrQuantizeFactor { //QuantizeScaleMode scale_mode; uint32_t scale_mode{0}; std::vector<uint8_t> scale_value; int64_t scale_offset{0}; std::vector<uint8_t> offset_data_value; int64_t offset_data_offset{0}; std::vector<uint8_t> offset_weight_value; int64_t offset_weight_offset{0}; std::vector<uint8_t> offset_pad_value; int64_t offset_pad_offset{0}; };
- Struct UsrQuantizeCalcFactor
struct UsrQuantizeCalcFactor { std::vector<uint8_t> offsetw; int64_t offsetw_offset{0}; std::vector<uint8_t> offsetd; int64_t offsetd_offset{0}; std::vector<uint8_t> scalereq; int64_t scaledreq_offset{0}; std::vector<uint8_t> offsetdnext; int64_t offsetdnext_offset{0}; };
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot