TensorRT学习笔记(1)基础知识

一、各项英文缩写词语的基本概念

1、UFF

Universal Framework Format 是一种描述DNN执行图的数据格式,绑定执行图的是输入和输出,UFF有严格规定的语法,支持核心运算的拓展,与完全用户自定义的运算。

包括以下内容:

Ø  具体序列化的格式,采用protobuf格式。

Ø  各种运算的有效定义,以python描述符来表述。

Ø  每个核心运算符执行文档。

2、PLANfile

PLAN文件是运行引擎用于执行网络的序列化数据。包含权重,网络中执行步骤以及用来决定如何绑定输入与输出缓存的网络信息。

3、NEF(NetworkExchange Format)

NEF是用来交换神经网络信息的数据格式。Caffe,UFF与ONNX是各种格式网络交换格式的样例。

4、Parser

TensorRT中设计用来解析NEF格式数据,建立运行引擎的前端。

Execution Context

运行上下文是前向引擎运行时需要的执行环境。

5、Engine

Engine是ICudaEngine的实例,Engine是前向运算示例。

6、NetworkDefinition

网络定义是由运算或者tensor组成的计算图。再TensorRT中是INetworkDefinition类型的示例,

7、CaffeFormat

Caffe格式的网络参数交换格式。

8、ONNX

ONNX格式的网络参数交换格式。

二、TensorRT  类

2 nvinfer1::DimsNCHW

是具有一个索引维度、一个通道维度和两个空间维度的数据的描述符。

nvinfer1::DimsNCHW::DimsNCHW(int batchSize,int channels,int height,int width)

3 IHostMemory

类来处理用户可访问的库分配内存

4 ILayer类

ILayer::getInput(int index) const

parameters: 

index the index of input tensor

return:the input tensor

5 IPlugin类

用户自定义层

5.1 IPlugin::configure(const Dims* inputDims,

                                   int    nbinputs,

                                   const Dims* outputDims,

                                   int nbOutputs,

                                   int maxBatchSize)

配置层

Parameters

inputDimsThe input tensor dimensions.
nbInputsThe number of inputs.
outputDimsThe output tensor dimensions.
nbOutputsThe number of outputs.
maxBatchSizeThe maximum batch size.

 

5.2 执行层(enqueue)

Parameters

batchSizeThe number of inputs in the batch.
inputsThe memory for the input tensors.
outputsThe memory for the output tensors.
workspaceWorkspace for execution.
streamThe stream in which to execute the kernels.

 

Returns

0 for success, else non-zero (which will cause engine termination).

5.3

Get the dimension of an output tensor.

Parameters

indexThe index of the output tensor.
inputsThe input tensors.
nbInputDimsThe number of input tensors.

5.4 IPlugin::getSerializationSize()

find the size of serialization buffer required

returns 

the size of serialization buffer

https://docs.nvidia.com/deeplearning/sdk/tensorrt-api/c_api/classnvinfer1_1_1_i_top_k_layer.html

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值