NVIDIA DRIVE OS Linux SDK API Reference

6.0.9 Release

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

◆ NVM_TENSOR_NCHW_C_STRIDE_INDEX

#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 203 of file nvmedia_tensormetadata.h.

◆ NVM_TENSOR_NCHW_E_STRIDE_INDEX

#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 176 of file nvmedia_tensormetadata.h.

◆ NVM_TENSOR_NCHW_H_STRIDE_INDEX

#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 195 of file nvmedia_tensormetadata.h.

◆ NVM_TENSOR_NCHW_N_STRIDE_INDEX

#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 212 of file nvmedia_tensormetadata.h.

◆ NVM_TENSOR_NCHW_W_STRIDE_INDEX

#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 186 of file nvmedia_tensormetadata.h.

NVM_TENSOR_NCHW_C_STRIDE_INDEX
#define NVM_TENSOR_NCHW_C_STRIDE_INDEX
Defines the stride index for NCHW channel.
Definition: nvmedia_tensormetadata.h:203
NVM_TENSOR_NCHW_N_STRIDE_INDEX
#define NVM_TENSOR_NCHW_N_STRIDE_INDEX
Defines the stride index for NCHW plane along the N dimension.
Definition: nvmedia_tensormetadata.h:212
NVM_TENSOR_NCHW_H_STRIDE_INDEX
#define NVM_TENSOR_NCHW_H_STRIDE_INDEX
Defines the stride index for NCHW line along the H dimension.
Definition: nvmedia_tensormetadata.h:195
NVM_TENSOR_NCHW_W_STRIDE_INDEX
#define NVM_TENSOR_NCHW_W_STRIDE_INDEX
Defines the stride index for NCHW column along the W dimension.
Definition: nvmedia_tensormetadata.h:186