模型信息

hbDNNGetModelNameList

int32_t hbDNNGetModelNameList(char const ***modelNameList, int32_t *modelNameCount, hbDNNPackedHandle_t dnnPackedHandle);

获取 dnnPackedHandle 所指向模型的名称列表和个数。

  • 参数
    • [out] modelNameList 模型名称列表。
    • [out] modelNameCount 模型名称个数。
    • [in] dnnPackedHandle Horizon DNN句柄,指向多个模型。
  • 返回值
    • 返回 0 则表示API成功执行,否则执行失败。

hbDNNGetModelHandle

int32_t hbDNNGetModelHandle(hbDNNHandle_t *dnnHandle, hbDNNPackedHandle_t dnnPackedHandle, char const *modelName);

dnnPackedHandle 所指向模型列表中获取一个模型的句柄。调用方可以跨函数、跨线程使用返回的 dnnHandle

  • 参数
    • [out] dnnHandle DNN句柄,指向一个模型。
    • [in] dnnPackedHandle DNN句柄,指向多个模型。
    • [in] modelName 模型名称。
  • 返回值
    • 返回 0 则表示API成功执行,否则执行失败。

hbDNNGetInputCount

int32_t hbDNNGetInputCount(int32_t *inputCount, hbDNNHandle_t dnnHandle);

获取 dnnHandle 所指向模型输入张量的个数。

  • 参数
    • [out] inputCount 模型输入张量的个数。
    • [in] dnnHandle DNN句柄,指向一个模型。
  • 返回值
    • 返回 0 则表示API成功执行,否则执行失败。

hbDNNGetInputName

int32_t hbDNNGetInputName(char const **name, hbDNNHandle_t dnnHandle, int32_t inputIndex);

获取 dnnHandle 所指向模型输入张量的名称。

  • 参数
    • [out] name 模型输入张量的名称。
    • [in] dnnHandle DNN句柄,指向一个模型。
    • [in] inputIndex 模型输入张量的编号。
  • 返回值
    • 返回 0 则表示API成功执行,否则执行失败。

hbDNNGetInputTensorProperties

int32_t hbDNNGetInputTensorProperties(hbDNNTensorProperties *properties, hbDNNHandle_t dnnHandle, int32_t inputIndex);

获取 dnnHandle 所指向模型特定输入张量的属性。

  • 参数
    • [out] properties 输入张量的信息。
    • [in] dnnHandle DNN句柄,指向一个模型。
    • [in] inputIndex 模型输入张量的编号。
  • 返回值
    • 返回 0 则表示API成功执行,否则执行失败。

hbDNNGetOutputCount

int32_t hbDNNGetOutputCount(int32_t *outputCount, hbDNNHandle_t dnnHandle);

获取 dnnHandle 所指向模型输出张量的个数。

  • 参数
    • [out] outputCount 模型输出张量的个数。
    • [in] dnnHandle DNN句柄,指向一个模型。
  • 返回值
    • 返回 0 则表示API成功执行,否则执行失败。

hbDNNGetOutputName

int32_t hbDNNGetOutputName(char const **name, hbDNNHandle_t dnnHandle, int32_t outputIndex);

获取 dnnHandle 所指向模型输出张量的名称。

  • 参数
    • [out] name 模型输出张量的名称。
    • [in] dnnHandle DNN句柄,指向一个模型。
    • [in] outputIndex 模型输出张量的编号。
  • 返回值
    • 返回 0 则表示API成功执行,否则执行失败。

hbDNNGetOutputTensorProperties

int32_t hbDNNGetOutputTensorProperties(hbDNNTensorProperties *properties, hbDNNHandle_t dnnHandle, int32_t outputIndex);

获取 dnnHandle 所指向模型特定输出张量的属性。

  • 参数
    • [out] properties 输出张量的信息。
    • [in] dnnHandle DNN句柄,指向一个模型。
    • [in] outputIndex 模型输出张量的编号。
  • 返回值
    • 返回 0 则表示API成功执行,否则执行失败。

hbDNNGetInputDesc

int32_t hbDNNGetInputDesc(char const **desc, uint32_t *size, int32_t *type, hbDNNHandle_t dnnHandle, int32_t inputIndex);

获取 dnnHandle 指向模型特定输入所关联的描述信息。

  • 参数
    • [out] desc 描述信息的首地址。
    • [out] size 描述信息的大小。
    • [out] type 描述信息的类型,详细类型请查看 hbDNNDescType
    • [in] dnnHandle DNN句柄,指向一个模型。
    • [in] inputIndex 模型输入的编号。
  • 返回值
    • 返回 0 则表示API成功执行,否则执行失败。

hbDNNGetOutputDesc

int32_t hbDNNGetOutputDesc(char const **desc, uint32_t *size, int32_t *type, hbDNNHandle_t dnnHandle, int32_t outputIndex);

获取 dnnHandle 指向模型特定输出所关联的描述信息。

  • 参数
    • [out] desc 描述信息的首地址。
    • [out] size 描述信息的大小。
    • [out] type 描述信息的类型,详细类型请查看 hbDNNDescType
    • [in] dnnHandle DNN句柄,指向一个模型。
    • [in] outputIndex 模型输出的编号。
  • 返回值
    • 返回 0 则表示API成功执行,否则执行失败。

hbDNNGetModelDesc

int32_t hbDNNGetModelDesc(char const **desc, uint32_t *size, int32_t *type, hbDNNHandle_t dnnHandle);

获取 dnnHandle 指向模型所关联的描述信息。

  • 参数
    • [out] desc 描述信息的首地址。
    • [out] size 描述信息的大小。
    • [out] type 描述信息的类型,详细类型请查看 hbDNNDescType
    • [in] dnnHandle DNN句柄,指向一个模型。
  • 返回值
    • 返回 0 则表示API成功执行,否则执行失败。

hbDNNGetHBMDesc

int32_t hbDNNGetHBMDesc(char const **desc, uint32_t *size, int32_t *type, hbDNNPackedHandle_t dnnPackedHandle, int32_t index);

获取 dnnPackedHandleindex 指向hbm所关联的描述信息。

  • 参数
    • [out] desc 描述信息的首地址。
    • [out] size 描述信息的大小。
    • [out] type 描述信息的类型,详细类型请查看 hbDNNDescType
    • [in] dnnPackedHandle Horizon DNN句柄,指向多个模型。
    • [in] index hbm索引。
  • 返回值
    • 返回 0 则表示API成功执行,否则执行失败。
注解

hbDNNInitializeFromFileshbDNNInitializeFromDDR 可支持同时加载多个hbm,因此索引范围应该在[0, modelFileCount)或者[0, modelDataCount), 这里 modelFileCountmodelDataCount 分别为两接口入参。