GraphParam

说明

图算子参数。

定义

struct GraphParam {
    std::string name;
    uint32_t inTensorNum = 0;
    uint32_t outTensorNum = 0;
    uint32_t internalTensorNum = 0;
    std::vector<Node> nodes;
    InferShapeFunc inferShapeFunc;
};

成员

成员名称

描述

name

图名称。

仅允许字母、数字、下划线,名称长度不超过128。

inTensorNum

图算子输入Tensor的数量,需小于或等于48,传入不正确的Tensor数量将返回“ERROR_INVALID_IN_TENSOR_NUM”报错,具体请参见ErrorType

outTensorNum

图算子输出Tensor的数量,需小于或等于48,传入不正确的Tensor数量将返回“ERROR_INVALID_IN_TENSOR_NUM”报错,具体请参见ErrorType

internalTensorNum

图算子中间Tensor的数量,需小于或等于48,传入不正确的Tensor数量将返回“ERROR_INVALID_IN_TENSOR_NUM”报错,具体请参见ErrorType

nodes

图算子Node Vector。

nodes的长度满足小于1024。

nodes的顺序,需要满足各个node对应operation的执行顺序依赖关系,先执行的在前面,后执行的在后面。

如果inTensorNum,outTensorNum与internalTensorNum之和为S,则nodes中各个元素的inTensorIds,outTensorIds中各元素值均要求落在[0, S-1]范围内。

inferShapeFunc

inferShape函数指针。