ONE - On-device Neural Engine
Loading...
Searching...
No Matches
nnkit::TensorContext Struct Referenceabstract

#include <TensorContext.h>

Public Types

template<typename T >
using TypedReader = std::function< void(const TensorContext &, uint32_t n, const nncc::core::ADT::tensor::Reader< T > &)>
 
template<typename T >
using TypedAccessor = std::function< void(const TensorContext &, uint32_t n, nncc::core::ADT::tensor::Accessor< T > &)>
 

Public Member Functions

virtual ~TensorContext ()=default
 
virtual uint32_t size (void) const =0
 
virtual std::string name (uint32_t n) const =0
 
virtual nncc::core::ADT::tensor::Shape shape (uint32_t n) const =0
 
virtual bool isFloatTensor (uint32_t n) const
 
virtual void getMutableFloatTensor (uint32_t n, const TypedAccessor< float > &cb)
 
virtual void getConstFloatTensor (uint32_t n, const TypedReader< float > &cb) const
 
virtual bool isS32Tensor (uint32_t n) const
 
virtual void getMutableS32Tensor (uint32_t n, const TypedAccessor< int32_t > &cb)
 
virtual void getConstS32Tensor (uint32_t n, const TypedReader< int32_t > &cb) const
 

Detailed Description

Definition at line 33 of file TensorContext.h.

Member Typedef Documentation

◆ TypedAccessor

template<typename T >
using nnkit::TensorContext::TypedAccessor = std::function<void(const TensorContext &, uint32_t n, nncc::core::ADT::tensor::Accessor<T> &)>

Definition at line 40 of file TensorContext.h.

◆ TypedReader

template<typename T >
using nnkit::TensorContext::TypedReader = std::function<void(const TensorContext &, uint32_t n, const nncc::core::ADT::tensor::Reader<T> &)>

Definition at line 36 of file TensorContext.h.

Constructor & Destructor Documentation

◆ ~TensorContext()

virtual nnkit::TensorContext::~TensorContext ( )
virtualdefault

Member Function Documentation

◆ getConstFloatTensor()

virtual void nnkit::TensorContext::getConstFloatTensor ( uint32_t  n,
const TypedReader< float > &  cb 
) const
inlinevirtual

◆ getConstS32Tensor()

virtual void nnkit::TensorContext::getConstS32Tensor ( uint32_t  n,
const TypedReader< int32_t > &  cb 
) const
inlinevirtual

Definition at line 83 of file TensorContext.h.

84 {
85 throw std::runtime_error("This method should be overriden");
86 }

◆ getMutableFloatTensor()

virtual void nnkit::TensorContext::getMutableFloatTensor ( uint32_t  n,
const TypedAccessor< float > &  cb 
)
inlinevirtual

◆ getMutableS32Tensor()

virtual void nnkit::TensorContext::getMutableS32Tensor ( uint32_t  n,
const TypedAccessor< int32_t > &  cb 
)
inlinevirtual

Definition at line 78 of file TensorContext.h.

79 {
80 throw std::runtime_error("This method should be overriden");
81 }

◆ isFloatTensor()

virtual bool nnkit::TensorContext::isFloatTensor ( uint32_t  n) const
inlinevirtual

◆ isS32Tensor()

virtual bool nnkit::TensorContext::isS32Tensor ( uint32_t  n) const
inlinevirtual

Definition at line 73 of file TensorContext.h.

74 {
75 throw std::runtime_error("This method should be overriden");
76 }

◆ name()

◆ shape()

◆ size()


The documentation for this struct was generated from the following file: