ONE - On-device Neural Engine
Loading...
Searching...
No Matches
luci::CircleConst Class Referencefinal

Class to build tensor data. More...

#include <CircleConst.h>

Collaboration diagram for luci::CircleConst:

Public Member Functions

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)
 
template<loco::DataType DT>
const loco::DataTypeImpl< DT >::Type & scalar (void) const
 
template<loco::DataType DT>
loco::DataTypeImpl< DT >::Type & scalar (void)
 
- Public Member Functions inherited from luci::FixedArityNode< 0, CircleNodeImpl< CircleOpcode::CIRCLECONST > >
 FixedArityNode ()
 
virtual ~FixedArityNode ()=default
 
uint32_t arity (void) const final
 
loco::Nodearg (uint32_t n) const final
 
void drop (void) final
 
- Public Member Functions inherited from luci::CircleNodeImpl< CircleOpcode::CIRCLECONST >
virtual ~CircleNodeImpl ()=default
 
uint32_t opnum (void) const final
 
CircleOpcode opcode (void) const final
 
- Public Member Functions inherited from luci::CircleNode
virtual ~CircleNode ()=default
 
const loco::Dialectdialect (void) const final
 Return "Dialect" identifier that this node belongs to.
 
template<typename T >
accept (CircleNodeVisitorBase< T > *) const
 
template<typename T >
accept (CircleNodeMutableVisitorBase< T > *)
 
NodeName name (void) const
 
void name (const NodeName &name)
 
CircleQuantParamquantparam (void) const
 
void quantparam (std::unique_ptr< CircleQuantParam > &&quantparam)
 
SparsityParamsparsityparam (void) const
 
void sparsityparam (std::unique_ptr< SparsityParam > &&sparsityparam)
 
ShapeStatus shape_status (void) const
 
void shape_status (ShapeStatus ss)
 
int32_t op_version (void) const
 
void op_version (int32_t op_version)
 
- 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 luci::FixedArityNode< 0, CircleNodeImpl< CircleOpcode::CIRCLECONST > >
loco::Useat (uint32_t n) const
 

Detailed Description

Class to build tensor data.

Note
This will not be exported as a specific op
Examples
/github/workspace/compiler/luci/pass/src/RemoveUnnecessaryTransposeNetPass.cpp, and /github/workspace/compiler/luci/pass/src/SubstituteExpandDimsToReshapePass.cpp.

Definition at line 34 of file CircleConst.h.

Member Function Documentation

◆ at() [1/2]

template<loco::DataType DT>
loco::DataTypeImpl< DT >::Type & luci::CircleConst::at ( uint32_t  n)

Definition at line 45 of file CircleConst.cpp.

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

◆ at() [2/2]

◆ scalar() [1/2]

template<loco::DataType DT>
loco::DataTypeImpl< DT >::Type & luci::CircleConst::scalar ( void  )

Definition at line 59 of file CircleConst.cpp.

60{
61 assert(dtype() == DT);
62 return *(reinterpret_cast<typename loco::DataTypeImpl<DT>::Type *>(_data.data()));
63}

◆ scalar() [2/2]

template<loco::DataType DT>
const loco::DataTypeImpl< DT >::Type & luci::CircleConst::scalar ( void  ) const

Definition at line 53 of file CircleConst.cpp.

54{
55 assert(dtype() == DT);
56 return *(reinterpret_cast<const typename loco::DataTypeImpl<DT>::Type *>(_data.data()));
57}

◆ size() [1/2]

template<loco::DataType DT>
void luci::CircleConst::size ( uint32_t  size)

Definition at line 31 of file CircleConst.cpp.

32{
33 assert(dtype() == DT);
34 _data.resize(l * sizeof(typename loco::DataTypeImpl<DT>::Type));
35}

◆ size() [2/2]


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