Template Function nvcv::cuda::CreateTensorWrapNHWC

Function Documentation

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

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

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

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.