GetInputConstData

Applicable Products

All processors

Header File/Library File

  • Header file: #include <graph/gnode.h>
  • Library file: libgraph.so

Function Usage

Obtains the value of an input Const node.

If the input of the operator is a Const node, the value of the Const node is returned. Otherwise, a failure message is returned. It supports checking whether the input is a Const node and retrieving its value across subgraphs.

Prototype

1
graphStatus GetInputConstData(const int32_t index, Tensor &data) const

Parameters

Parameter

Input/Output

Description

index

Input

Input port index of the operator.

data

Output

Value of the input Const.

Returns

Parameter

Type

Description

-

graphStatus

GRAPH_SUCCESS: success. GRAPH_NODE_WITHOUT_CONST_INPUT: The input is not a Const. Other values: failure.

Restrictions

None