ONE - On-device Neural Engine
Loading...
Searching...
No Matches
locoex::TFLConst Class Referencefinal

Class to build tensor data. More...

#include <TFLNodes.h>

Collaboration diagram for locoex::TFLConst:

Public Member Functions

 TFLConst ()=default
 
template<loco::DataType DT>
uint32_t size (void) const
 
template<loco::DataType DT>
void size (uint32_t size)
 
template<loco::DataType DT>
const loco::DataTypeImpl< DT >::Type & at (uint32_t n) const
 
template<loco::DataType DT>
loco::DataTypeImpl< DT >::Type & at (uint32_t n)
 
- Public Member Functions inherited from locoex::FixedArityNode< 0, TFLNodeImpl< TFLOpcode::CONST > >
 FixedArityNode ()
 
virtual ~FixedArityNode ()=default
 
unsigned arity (void) const final
 
loco::Nodearg (uint32_t n) const final
 
void drop (void) final
 
- Public Member Functions inherited from locoex::TFLNodeImpl< TFLOpcode::CONST >
virtual ~TFLNodeImpl ()=default
 
uint32_t opnum (void) const final
 
TFLOpcode opcode (void) const final
 
- Public Member Functions inherited from locoex::TFLNode
virtual ~TFLNode ()=default
 
const loco::Dialectdialect (void) const final
 Return "Dialect" identifier that this node belongs to.
 
template<typename T >
accept (TFLNodeVisitorBase< T > *) const
 
template<typename T >
accept (TFLNodeMutableVisitorBase< T > *)
 
- Public Member Functions inherited from loco::Node
 Node ()=default
 
 Node (const Node &)=delete
 
 Node (Node &&)=delete
 
virtual ~Node ()
 
Graphgraph (void)
 
const Graphgraph (void) const
 
- Public Member Functions inherited from loco::AnnotatedItem< NodeAnnotation >
 AnnotatedItem ()=default
 
virtual ~AnnotatedItem ()=default
 
const T * annot (void) const
 Retrieve a stored annotation of type T.
 
void annot (std::unique_ptr< T > &&p)
 Attach or remove a new annotation of type T.
 

Additional Inherited Members

- Protected Member Functions inherited from locoex::FixedArityNode< 0, TFLNodeImpl< TFLOpcode::CONST > >
loco::Useat (unsigned n) const
 

Detailed Description

Class to build tensor data.

Note
This will not be exported as a specific op

Definition at line 195 of file TFLNodes.h.

Constructor & Destructor Documentation

◆ TFLConst()

locoex::TFLConst::TFLConst ( )
default

Member Function Documentation

◆ at() [1/2]

template<loco::DataType DT>
loco::DataTypeImpl< DT >::Type & locoex::TFLConst::at ( uint32_t  n)

Definition at line 49 of file TFLNodes.cpp.

50{
51 assert(dtype() == DT);
52 assert(n < size<DT>());
53 return *(reinterpret_cast<typename loco::DataTypeImpl<DT>::Type *>(_data.data()) + n);
54}
C++ scalar type corresponding to each DataType.

◆ at() [2/2]

template<loco::DataType DT>
const loco::DataTypeImpl< DT >::Type & locoex::TFLConst::at ( uint32_t  n) const

Definition at line 42 of file TFLNodes.cpp.

43{
44 assert(dtype() == DT);
45 assert(n < size<DT>());
46 return *(reinterpret_cast<const typename loco::DataTypeImpl<DT>::Type *>(_data.data()) + n);
47}

Referenced by exo::TransposedConv2DConverter::convert().

◆ size() [1/2]

template<loco::DataType DT>
void locoex::TFLConst::size ( uint32_t  size)

Definition at line 35 of file TFLNodes.cpp.

36{
37 assert(dtype() == DT);
38 _data.resize(l * sizeof(typename loco::DataTypeImpl<DT>::Type));
39}

◆ size() [2/2]

template<loco::DataType DT>
uint32_t locoex::TFLConst::size ( void  ) const

Definition at line 28 of file TFLNodes.cpp.

29{
30 assert(dtype() == DT);
31 assert(_data.size() % sizeof(typename loco::DataTypeImpl<DT>::Type) == 0);
32 return _data.size() / sizeof(typename loco::DataTypeImpl<DT>::Type);
33}

Referenced by locoex::set_new_shape().


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