Class TensorDataStrided

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class TensorDataStrided : public nvcv::TensorData

Represents strided tensor data in the system.

The TensorDataStrided class extends TensorData to handle tensor data that is stored in a strided manner. Strided tensor data allows non-contiguous storage in memory, where each dimension can have its own stride and the stride is the amount of bytes to jump each element in that dimension.

Subclassed by nvcv::TensorDataStridedCuda

Public Functions

inline Byte *basePtr() const

Retrieves the base pointer of the tensor data in memory.

Returns:

A pointer to the base (starting address) of the tensor data.

inline const int64_t &stride(int d) const

Retrieves the stride for a specific dimension of the tensor.

Parameters:

d – The index of the dimension.

Returns:

The stride of the specified dimension.

Public Static Functions

static inline bool IsCompatibleKind(NVCVTensorBufferType kind)

Determines if a given tensor buffer type is compatible with strided data.

Parameters:

kind – The tensor buffer type to check.

Returns:

true if the buffer type is compatible with strided data, false otherwise.

Protected Functions

inline TensorData(const NVCVTensorData &data)

Constructs a TensorData object from an NVCVTensorData instance.

Parameters:

data – The underlying tensor data representation.

TensorData() = default