output_dtype(index)
infer(tensorList)
函数功能
通过输入Tensor列表进行模型推理。
输入参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| tensorList | List[base.Tensor] | Tensor列表。 |
返回参数说明
返回模型推理输出的List[base.Tensor]。
抛异常接口
分配Tensor内存失败及推理失败,抛出runtime异常。
父主题: Model类
infer(tensor, args)
函数功能
通过输入多个Tensor对象进行模型推理。
输入参数说明
参数名 | 类型 | 说明 |
|---|---|---|
tensor | Tensor对象 | 模型推理所需Tensor。 如需输入多个Tensor,请使用”,”以分隔形式传入,最大传入Tensor数量为1024。 |
args | 可变参数 |
返回参数说明
返回模型推理输出的List[base.Tensor]。
抛异常接口
参数校验失败,分配Tensor内存失败及推理失败,抛出runtime异常。
父主题: Model类
input_dtype(index)
函数功能
获得模型输入的对应Tensor的数据类型信息。
输入参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| index | int | 模型输入的索引(第index个输入)。 |
返回参数说明
返回输入Tensor的数据类型,base.dtype类型。
父主题: Model类
output_dtype(index)
函数功能
获得模型输出的对应Tensor的数据类型信息。
输入参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| index | int | 模型输出的索引(第index个输出)。 |
返回参数说明
返回输出Tensor的数据类型,base.dtype类型。
父主题: Model类
input_shape(index)
函数功能
获得模型输入的对应Tensor的数据shape信息。
输入参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| index | int | 模型输入的索引(第index个输入)。 |
返回参数说明
返回对应输入的Tensor的shape信息,List[int]类型。
父主题: Model类
output_shape(index)
函数功能
获得模型输出的对应Tensor的数据shape信息。
输入参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| index | int | 模型输出的索引(第index个输出)。 |
返回参数说明
返回对应输出的Tensor的shape信息,List[int]类型。
父主题: Model类
model_gear()
函数功能
获得模型支持的动态输入档位信息,支持动态Batch、动态分辨率和分档动态维度模型。
返回参数说明
返回模型支持的输入Tensor档位信息,List[List[int]]类型。
返回数据结构为空,表示获取分档信息失败或者模型不属于函数功能中描述的三种模型之一,具体的原因可查看报错信息确认。
例如,模型为动态分辨率模型,List[int]为某一档的高、宽值。
父主题: Model类
在线提单