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/graph.h>
  • Library file: libgraph.so

Function Usage

Obtains the attributes of a graph. This API is a generic API and its attribute type is attr_value.

Prototype

1
graphStatus GetAttr(const AscendString &name, AttrValue &attr_value) const

Parameters

Parameter

Input/Output

Description

name

Output

Attribute name of the graph.

attr_value

Output

Attribute value of the graph.

Returns

Parameter

Type

Description

-

graphStatus

GRAPH_SUCCESS(0): success.

Other values: failure.

Constraints

None

Examples

1
2
3
4
5
AttrValue av_get;
graph.GetAttr("int_attr", av_get);
int64_t int_attr_get{};
av_get.GetAttrValue(int_attr_get);
ASSERT_EQ(int_attr_get, 100);