GraphParam

Description

Graph operator parameters.

Definition

1
2
3
4
5
6
7
8
struct GraphParam {
    std::string name;
    uint32_t inTensorNum = 0;
    uint32_t outTensorNum = 0;
    uint32_t internalTensorNum = 0;
    std::vector<Node> nodes;
    InferShapeFunc inferShapeFunc = nullptr;
};

Parameters

Member

Data Type

Default Value

Description

name

std::string

-

Name of a graph operator.

The name contains a maximum of 128 characters, allowing only letters, digits, and underscores (_).

inTensorNum

uint32_t

0

Number of input tensors of a graph operator. The value must be less than or equal to 256. If the passed number of tensors is incorrect, the ERROR_INVALID_IN_TENSOR_NUM error is returned. For details, see ErrorType.

outTensorNum

uint32_t

0

Number of output tensors of a graph operator. The value must be less than or equal to 256. If the passed number of tensors is incorrect, the ERROR_INVALID_IN_TENSOR_NUM error is returned. For details, see ErrorType.

internalTensorNum

uint32_t

0

Number of intermediate tensors of a graph operator. The value must be less than or equal to 256. If the passed number of tensors is incorrect, the ERROR_INVALID_IN_TENSOR_NUM error is returned. For details, see ErrorType.

nodes

std::vector<Node>

-

Node vector of a graph operator.

The length of nodes must be less than 1024.

The sequence of nodes must meet the execution sequence dependency of corresponding Operations, with the earlier executed ones in the front and the later executed ones in the back.

If the sum of inTensorNum, outTensorNum, and internalTensorNum is S, the element values of inTensorIds and outTensorIds in each element of nodes must fall within [0, S-1].

inferShapeFunc

InferShapeFunc

nullptr

inferShape function pointer.