NVIDIA DRIVE OS Linux SDK API Reference

5.1.12.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Detailed Description

For NCHW tensor, assuming p,q,r,s correspond to N,C,H,W dimensions, the offset from the base address of the tensor to access a tensor value at coordinate (p,q,r,s) is calculated using the expression below:

offset = p * tensormetadata.dimstrides[NVM_TENSOR_NCHW_N_STRIDE_INDEX] +
q * tensormetadata.dimstrides[NVM_TENSOR_NCHW_C_STRIDE_INDEX] +
r * tensormetadata.dimstrides[NVM_TENSOR_NCHW_H_STRIDE_INDEX] +
s * tensormetadata.dimstrides[NVM_TENSOR_NCHW_W_STRIDE_INDEX]

Macros

#define NVM_TENSOR_NCHW_E_STRIDE_INDEX   0U
 Defines the stride index for NCHW element. More...
 
#define NVM_TENSOR_NCHW_W_STRIDE_INDEX   NVM_TENSOR_NCHW_E_STRIDE_INDEX
 Defines the stride index for NCHW column along the W dimension. More...
 
#define NVM_TENSOR_NCHW_H_STRIDE_INDEX   1U
 Defines the stride index for NCHW line along the H dimension. More...
 
#define NVM_TENSOR_NCHW_C_STRIDE_INDEX   2U
 Defines the stride index for NCHW channel. More...
 
#define NVM_TENSOR_NCHW_N_STRIDE_INDEX   3U
 Defines the stride index for NCHW plane along the N dimension. More...
 

Macro Definition Documentation

#define NVM_TENSOR_NCHW_C_STRIDE_INDEX   2U

Defines the stride index for NCHW channel.

tensormetadata.dimstrides[NVM_TENSOR_NCHW_C_STRIDE_INDEX] is stride in bytes to go from current channel(C) to the next channel(C) for NCHW tensor.

Definition at line 187 of file nvmedia_tensormetadata.h.

#define NVM_TENSOR_NCHW_E_STRIDE_INDEX   0U

Defines the stride index for NCHW element.

tensormetadata.dimstrides[NVM_TENSOR_NCHW_E_STRIDE_INDEX] is stride in bytes to go from current element to the next element for NCHW tensor

Definition at line 160 of file nvmedia_tensormetadata.h.

#define NVM_TENSOR_NCHW_H_STRIDE_INDEX   1U

Defines the stride index for NCHW line along the H dimension.

tensormetadata.dimstrides[NVM_TENSOR_NCHW_H_STRIDE_INDEX] is stride in bytes to go from one line to the next line or along H dimension for NCHW tensor.

Definition at line 179 of file nvmedia_tensormetadata.h.

#define NVM_TENSOR_NCHW_N_STRIDE_INDEX   3U

Defines the stride index for NCHW plane along the N dimension.

tensormetadata.dimstrides[NVM_TENSOR_NCHW_N_STRIDE_INDEX] is stride in bytes to go from one plane to the next plane along N dimension for NCHW tensor.

Definition at line 196 of file nvmedia_tensormetadata.h.

#define NVM_TENSOR_NCHW_W_STRIDE_INDEX   NVM_TENSOR_NCHW_E_STRIDE_INDEX

Defines the stride index for NCHW column along the W dimension.

tensormetadata.dimstrides[NVM_TENSOR_NCHW_W_STRIDE_INDEX] is stride in bytes to go from one column to the next column or along W dimension for NCHW tensor. The index is assigned to the same index as for the element stride.

Definition at line 170 of file nvmedia_tensormetadata.h.