下载
中文
注册

GetInputTensorShape

函数功能

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

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

函数原型

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

参数说明

参数名

输入/输出

说明

index

输入

模型输入的索引(第index个输入)。

返回参数说明

数据结构

说明

std::vector<int64_t>

对应输入的Tensor的shape信息。