下载
中文
注册

AscendNNInference

API定义

AscendNNInference(std::vector<int> deviceList, const char* model, uint64_t modelSize);

功能描述

AscendNNInference的构造函数,生成AscendNNInference,此时根据“deviceList”中配置的值设置Device侧昇腾AI处理器资源以及模型路径等。

输入

std::vector<int> deviceList:Device侧设备ID。

const char* model:深度神经网络降维模型。

uint64_t modelSize:深度神经网络降维模型的大小。

输出

返回值

约束说明

  • deviceList取值范围(0, 32]。
  • “model”需要为合法有效的深度网络降维模型的内存指针,大小为“modelSize”,modelSize取值范围为(0, 128MB],参数不匹配可能造成模型实例化或推理失败。非法的模型可能会对系统造成危害,请确保模型的来源合法有效。
    • dimsIn ∈ {64, 128, 256, 384, 512, 768, 1024}。
    • dimsOut ∈ {32, 64, 96, 128, 256,}。
    • batches ∈ {1, 2, 4, 8, 16, 32, 64, 128}