GetAttr

Applicability

Product

Supported or Not

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Header File/Library File

  • Header file: #include <graph/gnode.h>
  • Library file: libgraph.so

Function Usage

Obtains the value of a specified attribute.

Prototype

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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 vector<int64_t>.

attr_value

Output

Attribute value of type vector<int32_t>.

attr_value

Output

Attribute value of type vector<uint32_t>.

attr_value

Output

Attribute value of type vector<float>.

attr_value

Output

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

attr_value

Output

Attribute value of type vector<bool>.

attr_value

Output

Attribute value of type vector<Tensor>.

attr_value

Output

Bytes attribute value of type OpBytes, or vector<uint8_t>.

attr_value

Output

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

attr_value

Output

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

attr_value

Output

Attribute value of type DataType.

attr_value

Output

Attribute value of type AttrValue.

Returns

Parameter

Type

Description

-

graphStatus

GRAPH_SUCCESS(0): success.

Other values: failure.

Constraints

None