SetAttr

函数功能

设置Node属性的属性值。

Node可以包括多个属性,初次设置值后,算子属性值的类型固定,算子属性值的类型包括:

函数原型

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
graphStatus SetAttr(const AscendString &name, int64_t &attr_value) const
graphStatus SetAttr(const AscendString &name, int32_t &attr_value) const
graphStatus SetAttr(const AscendString &name, uint32_t &attr_value) const
graphStatus SetAttr(const AscendString &name, float32_t &attr_value) const
graphStatus SetAttr(const AscendString &name, AscendString &attr_value) const
graphStatus SetAttr(const AscendString &name, bool &attr_value) const
graphStatus SetAttr(const AscendString &name, Tensor &attr_value) const
graphStatus SetAttr(const AscendString &name, std::vector<int64_t> &attr_value) const
graphStatus SetAttr(const AscendString &name, std::vector<int32_t> &attr_value) const
graphStatus SetAttr(const AscendString &name, std::vector<uint32_t> &attr_value) const
graphStatus SetAttr(const AscendString &name, std::vector<float32_t> &attr_value) const
graphStatus SetAttr(const AscendString &name, std::vector<AscendString> &attr_values) const
graphStatus SetAttr(const AscendString &name, std::vector<bool> &attr_value) const
graphStatus SetAttr(const AscendString &name, std::vector<Tensor> &attr_value) const
graphStatus SetAttr(const AscendString &name, OpBytes &attr_value) const
graphStatus SetAttr(const AscendString &name, std::vector<std::vector<int64_t>> &attr_value) const
graphStatus SetAttr(const AscendString &name, std::vector<ge::DataType> &attr_value) const
graphStatus SetAttr(const AscendString &name, ge::DataType &attr_value) const
graphStatus SetAttr(const AscendString &name, AttrValue &attr_value) const

参数说明

参数名

输入/输出

描述

name

输入

属性名称

attr_value

输入

需设置的int64_t表示的整型类型属性值。

attr_value

输入

需设置的int32_t表示的整型类型属性值。

attr_value

输入

需设置的uint32_t表示的整型类型属性值。

attr_value

输入

需设置的浮点类型float的属性值。

attr_value

输入

需设置的字符串类型AscendString的属性值。

attr_value

输入

需设置的布尔类型bool的属性值。

attr_value

输入

需设置的Tensor类型的属性值。

attr_value

输入

需设置的vector<int64_t>表示的整型列表类型属性值。

attr_value

输入

需设置的vector<int32_t>表示的整型列表类型属性值。

attr_value

输入

需设置的vector<uint32_t>表示的整型列表类型属性值。

attr_value

输入

需设置的浮点列表类型vector<float>的属性值。

attr_value

输入

需设置的字符串列表类型vector<ge::AscendString>的属性值。

attr_value

输入

需设置的布尔列表类型vector<bool>的属性值。

attr_value

输入

需设置的Tensor列表类型vector<Tensor>的属性值。

attr_value

输入

需设置的Bytes,即字节数组类型的属性值,OpBytes即vector<uint8_t>。

attr_value

输入

需设置的vector<vector<int64_t>>表示的整型二维列表类型属性值。

attr_value

输入

需设置的vector<ge::DataType>表示的DataType列表类型属性值。

attr_value

输入

需设置的DataType类型的属性值。

attr_value

输入

需设置的AttrValue类型的属性值。

返回值

参数名

类型

描述

-

graphStatus

GRAPH_SUCCESS(0):成功。

其他值:失败。

约束说明

无。