Template Function nvcv::cuda::CreateTensorWrapNHW

Function Documentation

template<typename T, class = Require<HasTypeTraits<T>>>
__host__ auto nvcv::cuda::CreateTensorWrapNHW(const TensorDataStridedCuda &tensor)

Factory function to create an NHW tensor wrap given a tensor data.

The output TensorWrap is an NHW 3D tensor allowing to access data per batch (N), per row (H) and per column (W) of the input tensor. The input tensor data must have either NHWC or HWC layout, where the channel C is inside T, e.g. T=uchar3 for RGB8.

Template Parameters:

T – Type of the values to be accessed in the tensor wrap.

Parameters:

tensor[in] Reference to the tensor that will be wrapped.

Returns:

Tensor wrap useful to access tensor data in CUDA kernels.