GetAttr

Description

Obtains the value of a specified attribute.

Prototype

graphStatus GetAttr(const AscendString &name, int64_t &attr_value) const;
graphStatus GetAttr(const AscendString &name, int32_t &attr_value) const;
graphStatus GetAttr(const AscendString &name, uint32_t &attr_value) const;
graphStatus GetAttr(const AscendString &name, float32_t &attr_value) const;
graphStatus GetAttr(const AscendString &name, AscendString &attr_value) const;
graphStatus GetAttr(const AscendString &name, bool &attr_value) const;
graphStatus GetAttr(const AscendString &name, Tensor &attr_value) const;
graphStatus GetAttr(const AscendString &name, std::vector<int64_t> &attr_value) const;
graphStatus GetAttr(const AscendString &name, std::vector<int32_t> &attr_value) const;
graphStatus GetAttr(const AscendString &name, std::vector<uint32_t> &attr_value) const;
graphStatus GetAttr(const AscendString &name, std::vector<float32_t> &attr_value) const;
graphStatus GetAttr(const AscendString &name, std::vector<AscendString> &attr_values) const;
graphStatus GetAttr(const AscendString &name, std::vector<bool> &attr_value) const;
graphStatus GetAttr(const AscendString &name, std::vector<Tensor> &attr_value) const;
graphStatus GetAttr(const AscendString &name, OpBytes &attr_value) const;
graphStatus GetAttr(const AscendString &name, std::vector<std::vector<int64_t>> &attr_value) const;
graphStatus GetAttr(const AscendString &name, std::vector<ge::DataType> &attr_value) const;
graphStatus GetAttr(const AscendString &name, ge::DataType &attr_value) const;
graphStatus GetAttr(const AscendString &name, AttrValue &attr_value) const;

Parameters

Parameter

Input/Output

Description

name

Input

Attribute name.

attr_value

Output

Attribute value of type int64_t.

attr_value

Output

Attribute value of type int32_t.

attr_value

Output

Attribute value of type uint32_t.

attr_value

Output

Attribute value of type float.

attr_value

Output

Attribute value of type AscendString.

attr_value

Output

Attribute value of type bool.

attr_value

Output

Attribute value of type Tensor.

attr_value

Output

Attribute value of type std::vector<int64_t>.

attr_value

Output

Attribute value of type std::vector<int32_t>.

attr_value

Output

Attribute value of type std::vector<uint32_t>.

attr_value

Output

Attribute value of type std::vector<float>.

attr_value

Output

Attribute value of type std::vector<ge::AscendString>.

attr_value

Output

Attribute value of type std::vector<bool>.

attr_value

Output

Attribute value of type std::vector<Tensor>.

attr_value

Output

Attribute value of type OpBytes, or std::vector<uint8_t>.

attr_value

Output

Attribute value of type std::vector<std::vector<int64_t>>.

attr_value

Output

Attribute value of type std::vector<ge::DataType>.

attr_value

Output

Attribute value of type ge::DataType.

attr_value

Output

Attribute value of type AttrValue.

Returns

Parameter

Type

Description

-

graphStatus

GRAPH_SUCCESS(0) on success;

else, failure.

Restrictions

None