## NVIDIA DRIVE OS Linux SDK API Reference

#### 5.1.9.0 Release

Stride Indices - NHWC

## 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] +

## 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

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

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

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

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

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