aclgrphSetOpAttr

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

Function Usage

Sets node attributes to modify a graph.

Prototype

1
graphStatus aclgrphSetOpAttr(Graph &graph, aclgrphAttrType attr_type, const char_t *cfg_path)

Parameters

Parameter

Input/Output

Description

graph

Input/Output

Input: graph to be modified by setting attributes.

Output: modified graph.

attr_type

Input

The enumeration of attr_type is defined as follows:

enum aclgrphAttrType { ATTR_TYPE_KEEP_DTYPE = 0, ATTR_TYPE_WEIGHT_COMPRESS };

ATTR_TYPE_KEEP_DTYPE: preserves the computing precision of certain operators at model build time.

ATTR_TYPE_WEIGHT_COMPRESS: compresses weights for certain operators at model build time.

cfg_path

Output

Configuration file path. Example configuration files:

To preserve the computing precision:

Opname1
Opname2
...

To compress weight:

Opname1;Opname2

Returns

Parameter

Type

Description

-

graphStatus

GRAPH_SUCCESS(0): success.

Other values: failure. For details, see ge::graphStatus.

Restrictions

None