# NVIDIA DRIVE OS Linux SDK API Reference

##### 5.2.6 Release For Test and Development only
Stride Indices - NCHW

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

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

## ◆ 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 198 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 171 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 190 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 207 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 181 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.