ONE - On-device Neural Engine
Loading...
Searching...
No Matches
nnkit::support::moco::tf::TensorContext Class Referenceabstract

Parent class of InputTensorContext and OutputTensorContext. More...

#include <TensorContext.h>

Collaboration diagram for nnkit::support::moco::tf::TensorContext:

Public Member Functions

 TensorContext (const ParsedTensors &tensors)
 
 TensorContext (const TensorContext &)=delete
 
 TensorContext (TensorContext &&)=delete
 
uint32_t size (void) const override
 
std::string name (uint32_t n) const override
 
nncc::core::ADT::tensor::Shape shape (uint32_t n) const override
 
bool isFloatTensor (uint32_t n) const override
 
virtual void getMutableFloatTensor (uint32_t n, const nnkit::TensorContext::TypedAccessor< float > &f)=0
 
virtual void getConstFloatTensor (uint32_t n, const nnkit::TensorContext::TypedReader< float > &f) const =0
 
- Public Member Functions inherited from nnkit::TensorContext
virtual ~TensorContext ()=default
 
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
 

Additional Inherited Members

- Public Types inherited from nnkit::TensorContext
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 > &)>
 

Detailed Description

Parent class of InputTensorContext and OutputTensorContext.

Definition at line 42 of file TensorContext.h.

Constructor & Destructor Documentation

◆ TensorContext() [1/3]

nnkit::support::moco::tf::TensorContext::TensorContext ( const ParsedTensors tensors)
inline

Definition at line 45 of file TensorContext.h.

45 : _tensors(tensors)
46 {
47 // empty
48 }

◆ TensorContext() [2/3]

nnkit::support::moco::tf::TensorContext::TensorContext ( const TensorContext )
delete

◆ TensorContext() [3/3]

nnkit::support::moco::tf::TensorContext::TensorContext ( TensorContext &&  )
delete

Member Function Documentation

◆ getConstFloatTensor()

virtual void nnkit::support::moco::tf::TensorContext::getConstFloatTensor ( uint32_t  n,
const nnkit::TensorContext::TypedReader< float > &  f 
) const
pure virtual

◆ getMutableFloatTensor()

virtual void nnkit::support::moco::tf::TensorContext::getMutableFloatTensor ( uint32_t  n,
const nnkit::TensorContext::TypedAccessor< float > &  f 
)
pure virtual

◆ isFloatTensor()

bool nnkit::support::moco::tf::TensorContext::isFloatTensor ( uint32_t  n) const
inlineoverridevirtual

Reimplemented from nnkit::TensorContext.

Definition at line 70 of file TensorContext.h.

70{ return _tensors.at(n)->isFloatTensor(); }

◆ name()

std::string nnkit::support::moco::tf::TensorContext::name ( uint32_t  n) const
inlineoverridevirtual

Implements nnkit::TensorContext.

Definition at line 57 of file TensorContext.h.

58 {
59 return _tensors.at(n)->name();
60 }

◆ shape()

nncc::core::ADT::tensor::Shape nnkit::support::moco::tf::TensorContext::shape ( uint32_t  n) const
inlineoverridevirtual

◆ size()

uint32_t nnkit::support::moco::tf::TensorContext::size ( void  ) const
inlineoverridevirtual

Implements nnkit::TensorContext.

Definition at line 54 of file TensorContext.h.

54{ return _tensors.size(); }

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