跳到主要内容

GetInputTensorDataType

GetInputTensorShape​

函数功能​

获得模型输入的对应Tensor的数据shape信息。

动态模型场景下对应的动态维度查询结果为-1。如果要使用查询的结果直接传入Tensor构造函数构造Tensor,需要将int64_t数据转换为uint32_t数据。

函数原型​

std::vector<int64_t> GetInputTensorShape(uint32_t index = 0)

参数说明​

参数名输入/输出说明
index输入模型输入的索引(第index个输入)。

返回参数说明​

数据结构说明
std::vector<int64_t>对应输入的Tensor的shape信息。

父主题: Model

GetOutputTensorShape​

函数功能​

获得模型输出的对应Tensor的数据shape信息。查询的结果可直接传入Tensor构造函数用来构造Tensor。

函数原型​

std::vector<uint32_t> GetOutputTensorShape(uint32_t index = 0)

参数说明​

参数名输入/输出说明
index输入模型输出的索引(第index个输出)。

返回参数说明​

数据结构说明
std::vector<uint32_t>对应输出的Tensor的shape信息。

父主题: Model

GetInputTensorDataType​

函数功能​

获得模型输入的对应Tensor的数据类型信息。

函数原型​

MxBase::TensorDType GetInputTensorDataType(uint32_t index = 0)

参数说明​

参数名输入/输出说明
index输入模型输入的索引(第index个输入)。

返回参数说明​

数据结构说明
MxBase::TensorDTypeTensor的数据类型,具体请参见TensorDType。

父主题: Model

GetOutputTensorDataType​

函数功能​

获得模型输出的对应Tensor的数据类型信息。

函数原型​

MxBase::TensorDType GetOutputTensorDataType(uint32_t index = 0)

参数说明​

参数名输入/输出说明
index输入模型输出的索引(第index个输出)。

返回参数说明​

数据结构说明
MxBase::TensorDTypeTensor的数据类型,具体请参见TensorDType。

父主题: Model

GetInputFormat​

函数功能​

获得模型输入的数据组织形式(NHWC 或者 NCHW)。

函数原型​

MxBase::VisionDataFormat GetInputFormat()

返回参数说明​

数据结构说明
MxBase::VisionDataFormat模型的输入数据组织形式,具体请参见VisionDataFormat。

父主题: Model

GetDynamicGearInfo​

函数功能​

获得模型支持的动态输入档位信息,支持动态Batch、动态分辨率和分档动态维度模型。

函数原型​

std::vector<std::vector<uint64_t>> GetDynamicGearInfo()

返回参数说明​

数据结构说明
std::vector<std::vector<uint64_t>>模型支持的输入Tensor档位信息。
- **std::vector<std::vector<uint64_t>>**为所有档位信息。
- **std::vector<uint64_t>**为某一档的具体值。
返回数据结构为空,表示获取分档信息失败或者模型不属于函数功能中描述的三种模型之一,具体的原因可查看报错信息确认。 例如,模型为动态分辨率模型,**std::vector<uint64_t>**为某一档的高、宽值。

父主题: Model

在线提单