NVIDIA DRIVE OS Linux SDK API Reference

6.0.9 Release

Detailed Description

For NCxHWx 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_NCxHWx_N_STRIDE_INDEX] +
floor(q/x) * tensormetadata.dimstrides[NVM_TENSOR_NCxHWx_Cx_STRIDE_INDEX] +
r * tensormetadata.dimstrides[NVM_TENSOR_NCxHWx_H_STRIDE_INDEX] +
s * tensormetadata.dimstrides[NVM_TENSOR_NCxHWx_W_STRIDE_INDEX] +
(q % x) * tensormetadata.dimstrides[NVM_TENSOR_NCxHWx_X_STRIDE_INDEX] +
s * tensormetadata.dimstrides[NVM_TENSOR_NCHW_W_STRIDE_INDEX]
#define NVM_TENSOR_NCxHWx_E_STRIDE_INDEX   0U
 Defines the stride index for NCxHWx element. More...
 
#define NVM_TENSOR_NCxHWx_X_STRIDE_INDEX   NVM_TENSOR_NCxHWx_E_STRIDE_INDEX
 Defines the stride index for NCxHWx channel. More...
 
#define NVM_TENSOR_NCxHWx_W_STRIDE_INDEX   1U
 Defines the stride index for NCxHWx column along the W dimension. More...
 
#define NVM_TENSOR_NCxHWx_H_STRIDE_INDEX   2U
 Defines the stride index for NCxHWx line along the H dimension. More...
 
#define NVM_TENSOR_NCxHWx_Cx_STRIDE_INDEX   3U
 Defines the stride index for NCxHWx channel along the Cx dimension. More...
 
#define NVM_TENSOR_NCxHWx_N_STRIDE_INDEX   4U
 Defines the stride index for NCxHWx plane along the N dimension. More...
 

Macro Definition Documentation

◆ NVM_TENSOR_NCxHWx_Cx_STRIDE_INDEX

#define NVM_TENSOR_NCxHWx_Cx_STRIDE_INDEX   3U

Defines the stride index for NCxHWx channel along the Cx dimension.

tensormetadata.dimstrides[NVM_TENSOR_NCxHWx_Cx_STRIDE_INDEX] is stride in bytes to go from one channel(C) to the next channel(C) along the Cx dimension for the NCxHWx tensor.

Definition at line 278 of file nvmedia_tensormetadata.h.

◆ NVM_TENSOR_NCxHWx_E_STRIDE_INDEX

#define NVM_TENSOR_NCxHWx_E_STRIDE_INDEX   0U

Defines the stride index for NCxHWx element.

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

Definition at line 241 of file nvmedia_tensormetadata.h.

◆ NVM_TENSOR_NCxHWx_H_STRIDE_INDEX

#define NVM_TENSOR_NCxHWx_H_STRIDE_INDEX   2U

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

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

Definition at line 269 of file nvmedia_tensormetadata.h.

◆ NVM_TENSOR_NCxHWx_N_STRIDE_INDEX

#define NVM_TENSOR_NCxHWx_N_STRIDE_INDEX   4U

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

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

Definition at line 287 of file nvmedia_tensormetadata.h.

◆ NVM_TENSOR_NCxHWx_W_STRIDE_INDEX

#define NVM_TENSOR_NCxHWx_W_STRIDE_INDEX   1U

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

tensormetadata.dimstrides[NVM_TENSOR_NCxHWx_W_STRIDE_INDEX] is stride in bytes to go from one column to the next column or along W dimension for NCxHWx tensor.

Definition at line 260 of file nvmedia_tensormetadata.h.

◆ NVM_TENSOR_NCxHWx_X_STRIDE_INDEX

#define NVM_TENSOR_NCxHWx_X_STRIDE_INDEX   NVM_TENSOR_NCxHWx_E_STRIDE_INDEX

Defines the stride index for NCxHWx channel.

tensormetadata.dimstrides[NVM_TENSOR_NCxHWx_H_STRIDE_INDEX] is stride in bytes to go from one channel(C) to the next channel(C) along X dimension for the NCxHWx tensor. The index is assigned to the same index as for the element stride.

Definition at line 251 of file nvmedia_tensormetadata.h.

NVM_TENSOR_NCxHWx_X_STRIDE_INDEX
#define NVM_TENSOR_NCxHWx_X_STRIDE_INDEX
Defines the stride index for NCxHWx channel.
Definition: nvmedia_tensormetadata.h:251
NVM_TENSOR_NCxHWx_Cx_STRIDE_INDEX
#define NVM_TENSOR_NCxHWx_Cx_STRIDE_INDEX
Defines the stride index for NCxHWx channel along the Cx dimension.
Definition: nvmedia_tensormetadata.h:278
NVM_TENSOR_NCxHWx_W_STRIDE_INDEX
#define NVM_TENSOR_NCxHWx_W_STRIDE_INDEX
Defines the stride index for NCxHWx column along the W dimension.
Definition: nvmedia_tensormetadata.h:260
NVM_TENSOR_NCxHWx_H_STRIDE_INDEX
#define NVM_TENSOR_NCxHWx_H_STRIDE_INDEX
Defines the stride index for NCxHWx line along the H dimension.
Definition: nvmedia_tensormetadata.h:269
NVM_TENSOR_NCxHWx_N_STRIDE_INDEX
#define NVM_TENSOR_NCxHWx_N_STRIDE_INDEX
Defines the stride index for NCxHWx plane along the N dimension.
Definition: nvmedia_tensormetadata.h:287
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