edge::qnn::TensorImpl class final
#include <tensor.hpp>

Concrete implementation of the Tensor interface for QNN.

Base classes

class edge::Tensor
A base class for representing a tensor object.

Constructors, destructors, conversion operators

TensorImpl(Qnn_Tensor_t* qnnTensor = nullptr, bool allocate = true) explicit
Constructor for TensorImpl.
TensorImpl(const TensorImpl& other) defaulted
TensorImpl(TensorImpl&&) defaulted
~TensorImpl() defaulted final

Public functions

auto operator=(const TensorImpl&) -> TensorImpl & defaulted
auto operator=(TensorImpl&&) -> TensorImpl & defaulted
auto getName() const -> std::string final
Get the name of the tensor.
auto getType() const -> TensorType final
Get the type of the tensor.
auto getDimensions() const -> std::vector< size_t > final
Get the dimensions of the tensor.
auto getSize() const -> size_t final
Get the total size of the tensor.

Protected functions

auto getDataPtr() -> void * final
Get a pointer to the data of the tensor.
auto getNumBytes() -> size_t final
Get the number of bytes occupied by the tensor data.

Function documentation

edge::qnn::TensorImpl::TensorImpl(Qnn_Tensor_t* qnnTensor = nullptr, bool allocate = true) explicit

Constructor for TensorImpl.

Parameters
qnnTensor Pointer to the QnnTensor object.
allocate Whether to allocate underlying memory for the Tensor.

auto edge::qnn::TensorImpl::getName() const -> std::string final

Get the name of the tensor.

Returns The name of the tensor as a string.

auto edge::qnn::TensorImpl::getType() const -> TensorType final

Get the type of the tensor.

Returns The type of the tensor as a TensorType enum.

auto edge::qnn::TensorImpl::getDimensions() const -> std::vector< size_t > final

Get the dimensions of the tensor.

Returns A vector of size_t representing the dimensions of the tensor.

auto edge::qnn::TensorImpl::getSize() const -> size_t final

Get the total size of the tensor.

Returns The total size of the tensor in number of elements.

auto edge::qnn::TensorImpl::getDataPtr() -> void * final protected

Get a pointer to the data of the tensor.

Returns A void pointer to the data of the tensor.

auto edge::qnn::TensorImpl::getNumBytes() -> size_t final protected

Get the number of bytes occupied by the tensor data.

Returns The number of bytes occupied by the tensor data.