NVIDIA DRIVE OS Linux SDK API Reference

5.1.15.2 Release
For Test and Development only

Detailed Description

For the NHWC tensor, assuming p,q,r,s correspond to N,H,W,C 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_NHWC_N_STRIDE_INDEX] +
q * tensormetadata.dimstrides[NVM_TENSOR_NHWC_H_STRIDE_INDEX] +
r * tensormetadata.dimstrides[NVM_TENSOR_NHWC_W_STRIDE_INDEX] +
s * tensormetadata.dimstrides[NVM_TENSOR_NHWC_C_STRIDE_INDEX]

Macros

#define NVM_TENSOR_NHWC_E_STRIDE_INDEX   0U
 Defines the stride index for NHWC element. More...
 
#define NVM_TENSOR_NHWC_C_STRIDE_INDEX   NVM_TENSOR_NHWC_E_STRIDE_INDEX
 Defines the stride index for NHWC channel. More...
 
#define NVM_TENSOR_NHWC_W_STRIDE_INDEX   1U
 Defines the stride index for NHWC column along the W dimension. More...
 
#define NVM_TENSOR_NHWC_H_STRIDE_INDEX   2U
 Defines the stride index for NHWC line along the H dimension. More...
 
#define NVM_TENSOR_NHWC_N_STRIDE_INDEX   3U
 Defines the stride index for NHWC plane along the N dimension. More...
 

Macro Definition Documentation

◆ NVM_TENSOR_NHWC_C_STRIDE_INDEX

#define NVM_TENSOR_NHWC_C_STRIDE_INDEX   NVM_TENSOR_NHWC_E_STRIDE_INDEX

Defines the stride index for NHWC channel.

tensormetadata.dimstrides[NVM_TENSOR_NHWC_C_STRIDE_INDEX] is stride in bytes to go from current channel(C) to the next channel(C) for NHWC tensor. The index is assigned to the same index as for the element stride.

Definition at line 114 of file nvmedia_tensormetadata.h.

◆ NVM_TENSOR_NHWC_E_STRIDE_INDEX

#define NVM_TENSOR_NHWC_E_STRIDE_INDEX   0U

Defines the stride index for NHWC element.

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

Definition at line 105 of file nvmedia_tensormetadata.h.

◆ NVM_TENSOR_NHWC_H_STRIDE_INDEX

#define NVM_TENSOR_NHWC_H_STRIDE_INDEX   2U

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

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

Definition at line 132 of file nvmedia_tensormetadata.h.

◆ NVM_TENSOR_NHWC_N_STRIDE_INDEX

#define NVM_TENSOR_NHWC_N_STRIDE_INDEX   3U

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

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

Definition at line 141 of file nvmedia_tensormetadata.h.

◆ NVM_TENSOR_NHWC_W_STRIDE_INDEX

#define NVM_TENSOR_NHWC_W_STRIDE_INDEX   1U

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

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

Definition at line 123 of file nvmedia_tensormetadata.h.

NVM_TENSOR_NHWC_H_STRIDE_INDEX
#define NVM_TENSOR_NHWC_H_STRIDE_INDEX
Defines the stride index for NHWC line along the H dimension.
Definition: nvmedia_tensormetadata.h:132
NVM_TENSOR_NHWC_N_STRIDE_INDEX
#define NVM_TENSOR_NHWC_N_STRIDE_INDEX
Defines the stride index for NHWC plane along the N dimension.
Definition: nvmedia_tensormetadata.h:141
NVM_TENSOR_NHWC_C_STRIDE_INDEX
#define NVM_TENSOR_NHWC_C_STRIDE_INDEX
Defines the stride index for NHWC channel.
Definition: nvmedia_tensormetadata.h:114
NVM_TENSOR_NHWC_W_STRIDE_INDEX
#define NVM_TENSOR_NHWC_W_STRIDE_INDEX
Defines the stride index for NHWC column along the W dimension.
Definition: nvmedia_tensormetadata.h:123