当前位置:网站首页>Detailed definition of tensorrt data format
Detailed definition of tensorrt data format
2022-07-02 06:27:00 【Little Heshang sweeping the floor】
TensorRT Detailed definition of data format
Click here to join NVIDIA Developer Program
TensorRT Support different data formats . There are two aspects to consider : Data type and layout .
Data type format
The data type is the representation of each individual value . Its size determines the range of values and the accuracy of the representation , Namely FP32
(32 Bit floating point , Or single precision ),FP16
(16 Bit floating point or half precision ),INT32
(32 Bit integers represent ), and INT8
(8 Who said ).
Layout format
The layout format determines the order in which values are stored . Usually ,batch Dimension is the leftmost dimension , Other dimensions refer to aspects of each data item , For example, in the image C It's a channel , H It's height , W It's the width . Ignore the batch size always before these , C 、 H and W Usually sorted as CHW ( See chart 1 ) or HWC ( See chart 2 ).
chart 1. CHW The layout of : The image is divided into HxW matrix , One per channel , The matrix is stored sequentially ; All values of the channel are stored continuously .
chart 2. HWC The layout of : Images are stored as a single file HxW matrix , The value is actually C Tuples , Each channel has a value ; One point ( Pixels ) All values of are stored continuously .
For faster computing , More formats are defined to package channel values together and use reduced precision . therefore ,TensorRT And support NC / 2HW2
and NHWC8
Equiform .
stay NC / 2HW2 ( TensorFormat::kCHW2 )
in , Channel value pairs are in each HxW Packed together in a matrix ( Null in case of odd channels ). The result is a format , among ⌈ C/2 ⌉ HxW
The value of the matrix is the value pair of two consecutive channels ( See chart 3 ); Please note that , If they are in the same pair , Then this sort interleaves the dimensions into steps 1 Value of the channel of , Otherwise, the step size will be 2xHxW .
The following figure shows a pair of channel values in each HxW Packed together in a matrix . The result is a format , among [C/2] HxW
The value of the matrix is the value pair of two consecutive channels
stay NHWC8 ( TensorFormat::kHWC8 )
in , HxW The entries of the matrix include the values of all channels ( See chart 4 ). Besides , These values are packaged in ⌈ C/8 ⌉
8 Tuple , also C Round up to the nearest 8 Multiple .
The following figure is in this NHWC8
In the format , HxW The entries of the matrix include the values of all channels .
other TensorFormat Follow the above mentioned TensorFormat::kCHW2
and TensorFormat::kHWC8
Similar rules .
边栏推荐
- 锐捷EBGP 配置案例
- LeetCode 39. Combined sum
- 日志 - 7 - 记录一次丢失文件(A4纸)的重大失误
- It is said that Kwai will pay for the Tiktok super fast version of the video? How can you miss this opportunity to collect wool?
- MySQL的10大經典錯誤
- ModuleNotFoundError: No module named ‘jieba.analyse‘; ‘jieba‘ is not a package
- The Chinese word segmentation task is realized by using traditional methods (n-gram, HMM, etc.), neural network methods (CNN, LSTM, etc.) and pre training methods (Bert, etc.)
- CUDA中的Warp matrix functions
- 找到页面当前元素z-index最高的数值
- 底层机制Mvcc
猜你喜欢
Common means of modeling: combination
Idea announced a new default UI, which is too refreshing (including the application link)
Summary of WLAN related knowledge points
Redis - grande question clé
LeetCode 90. 子集 II
锐捷EBGP 配置案例
Redis - hot key issues
Pbootcms collection and warehousing tutorial quick collection release
Decryption skills of encrypted compressed files
实现strStr() II
随机推荐
TensorRT中的循环
ctf-web之练习赛
BGP中的状态机
Detailed explanation of BGP message
Sublime Text 配置php编译环境
栈(线性结构)
【程序员的自我修养]—找工作反思篇二
Redis——热点key问题
Sparse array (nonlinear structure)
Web components series (VIII) -- custom component style settings
Redis——大Key问题
Hydration failed because the initial UI does not match what was rendered on the server.问题原因之一
Redis - grande question clé
LeetCode 90. 子集 II
Does the assignment of Boolean types such as tag attribute disabled selected checked not take effect?
LeetCode 27. 移除元素
代码技巧——Controller参数注解@RequestParam
Cglib代理-代码增强测试
sudo提权
LeetCode 83. Delete duplicate elements in the sorting linked list