SetAttr

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Header File/Library File

  • Header file: #include <ge/es_graph_builder.h>
  • Library files: libeager_style_graph_builder_base.so and libeager_style_graph_builder_base_static.a

Function Usage

Sets the type attribute of a graph.

Prototype

  • Set the int64 attribute of a graph.
    1
    Status SetAttr(const char *attr_name, int64_t value)
    
  • Set the string attribute of a graph.
    1
    Status SetAttr(const char *attr_name, const char *value)
    
  • Set the Boolean attribute of a graph.
    1
    Status SetAttr(const char *attr_name, bool value)
    

Parameters

Parameter

Input/Output

Description

attr_name

Input

Attribute name.

value

Input

Attribute value.

Returns

Parameter

Type

Description

-

Status

SUCCESS: success.

Other values: failure.

Restrictions

None

Example

1
2
EsGraphBuilder builder("test_graph");
builder.SetAttr("int64_attr", static_cast<int64_t>(10))