SetAttrForNode

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 <ge/es_tensor_holder.h>
  • Library files: libeager_style_graph_builder_base.so and libeager_style_graph_builder_base_static.a

Function Usage

Sets the private attributes of the node for TensorHolder.

Prototype

1
2
3
Status SetAttrForNode(const char *attr_name, int64_t value)
Status SetAttrForNode(const char *attr_name, const char *value)
Status SetAttrForNode(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

GRAPH_SUCCESS(0): success.

Other values: failure.

Constraints

None

Examples

1
2
3
  auto builder = std::make_unique<ge::EsGraphBuilder>("graph");
  auto tensor0 = builder->CreateInput(0);
  (void) tensor0.SetAttrForNode("node_attr_int64", int64_t(123)); // Set the private attribute of an input node. Specifically, set the attribute name to node_attr_int64 and the attribute value to 123.