|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
Owns a DLPack tensor received from another library. More...
#include <TensorDLPack.hpp>
Public Member Functions | |
| std::optional< TensorAccess > | access () const |
| Borrow the producer's memory. | |
| std::optional< TensorData > | copy () const |
| Dense owning copy, independent of the producer. | |
| TensorImport & | operator= (const TensorImport &)=delete |
| TensorImport & | operator= (TensorImport &&other) noexcept |
| bool | read_only () const noexcept |
| Whether the producer marked the tensor read-only. | |
| const TensorSpec & | spec () const noexcept |
| Layout described by the producer. | |
| TensorImport (const TensorImport &)=delete | |
| TensorImport (TensorImport &&other) noexcept | |
| ~TensorImport () | |
Static Public Member Functions | |
| static std::optional< TensorImport > | take (DLManagedTensor *managed) |
| Take ownership of a legacy, unversioned DLPack tensor. | |
| static std::optional< TensorImport > | take (DLManagedTensorVersioned *managed) |
| Take ownership of a versioned DLPack tensor. | |
Private Member Functions | |
| TensorImport (TensorSpec spec, const std::byte *data, size_t size, bool read_only, std::function< void()> release) noexcept | |
Private Attributes | |
| const std::byte * | m_data {} |
| bool | m_read_only {} |
| std::function< void()> | m_release |
| size_t | m_size {} |
| TensorSpec | m_spec |
Owns a DLPack tensor received from another library.
Takes the producer's tensor, validates it, and exposes it as a TensorAccess without copying. The producer's deleter runs when this object is destroyed or when the tensor is rejected.
Usage:
Definition at line 40 of file TensorDLPack.hpp.