GetAttr
Applicability
Product |
Supported or Not |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
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); |
Parent topic: Graph