Skip to navigation

holoscan::make_tensor_from_dlpack_versioned

Beta
View as Markdown
HOLOSCAN_CORE_EXPORT expected<Tensor, Error> holoscan::make_tensor_from_dlpack_versioned(
DLManagedTensorVersioned *dl_managed_tensor_ver_ptr
)

Create a Tensor from a versioned DLManagedTensorVersioned, validating the producer handle.

The DLPack version and flags are preserved and imported storage is permanently narrowed to read-only authority. Per the DLPack contract a consumer must reject a newer major version (the struct layout may have changed); rejection leaves ownership with the producer. On success the returned Tensor owns the producer’s DLPack deleter.

Returns: The imported Tensor, or an Error (kInvalidArgument) if the pointer is null or the DLPack major version is newer than supported.

Parameters

dl_managed_tensor_ver_ptr
DLManagedTensorVersioned *

A pointer to the DLManagedTensorVersioned to import.