ONE - On-device Neural Engine
Loading...
Searching...
No Matches
locop Namespace Reference

Data Structures

class  ArgDesc
 
class  CanonicalNodeSummaryBuilder
 Built-in Node Summary Builder for Canonical Dialect. More...
 
struct  FormattedGraph
 
class  FormattedGraphImpl
 
class  FormattedGraphImpl< Formatter::LinearV1 >
 
class  FormattedTensorShape
 
class  FormattedTensorShape< TensorShapeFormat::Bracket >
 
class  FormattedTensorShape< TensorShapeFormat::Plain >
 
class  GenericNodeSummaryBuilder
 Dialect-agnostic Node Summary Builder. More...
 
struct  NodeDesc
 
struct  NodeSummaryBuilder
 Build a summary from loco Node. More...
 
struct  NodeSummaryBuilderFactory
 
struct  Spec
 
struct  Spec< Interface::Formatted >
 
struct  SymbolTable
 Symbol Table Interface. More...
 

Typedefs

using OpName = std::string
 
using ArgName = std::string
 
using ArgValue = std::string
 
using ArgElem = std::pair< ArgName, ArgValue >
 
using NodeSummary = NodeDesc
 

Enumerations

enum  Formatter { LinearV1 }
 
enum class  TensorShapeFormat { Plain , Bracket }
 
enum class  Interface { Formatted }
 

Functions

std::ostream & operator<< (std::ostream &, const FormattedGraph &)
 
template<Formatter F>
FormattedGraphImpl< F > fmt (loco::Graph *g)
 
template<Formatter F>
FormattedGraphImpl< F > fmt (const std::unique_ptr< loco::Graph > &g)
 
template<TensorShapeFormat F>
FormattedTensorShape< F > fmt (loco::TensorShape *ptr)
 
std::ostream & operator<< (std::ostream &, const Spec< Interface::Formatted > &)
 
std::ostream & operator<< (std::ostream &os, const NodeDesc &d)
 

Typedef Documentation

◆ ArgElem

using locop::ArgElem = typedef std::pair<ArgName, ArgValue>

Definition at line 31 of file NodeSummary.h.

◆ ArgName

using locop::ArgName = typedef std::string

Definition at line 29 of file NodeSummary.h.

◆ ArgValue

using locop::ArgValue = typedef std::string

Definition at line 30 of file NodeSummary.h.

◆ NodeSummary

using locop::NodeSummary = typedef NodeDesc

Definition at line 110 of file NodeSummary.h.

◆ OpName

using locop::OpName = typedef std::string

Definition at line 28 of file NodeSummary.h.

Enumeration Type Documentation

◆ Formatter

Enumerator
LinearV1 

Definition at line 45 of file FormattedGraph.h.

46{
48 // TO BE ADDED
49};

◆ Interface

enum class locop::Interface
strong
Enumerator
Formatted 

Definition at line 25 of file Interfaces.h.

26{
28};

◆ TensorShapeFormat

enum class locop::TensorShapeFormat
strong
Enumerator
Plain 
Bracket 

Definition at line 27 of file FormattedTensorShape.h.

28{
29 // D_0 x D_1 x ... D_N
30 Plain,
31 // [ D_0 x D_1 x D_2 x ... ]
32 Bracket,
33};

Function Documentation

◆ fmt() [1/3]

template<Formatter F>
FormattedGraphImpl< F > locop::fmt ( const std::unique_ptr< loco::Graph > &  g)

Definition at line 82 of file FormattedGraph.h.

83{
84 return fmt<F>(g.get());
85}

◆ fmt() [2/3]

template<Formatter F>
FormattedGraphImpl< F > locop::fmt ( loco::Graph g)

Definition at line 77 of file FormattedGraph.h.

Referenced by operator<<().

◆ fmt() [3/3]

template<TensorShapeFormat F>
FormattedTensorShape< F > locop::fmt ( loco::TensorShape ptr)

Definition at line 69 of file FormattedTensorShape.h.

◆ operator<<() [1/3]

std::ostream & locop::operator<< ( std::ostream &  os,
const FormattedGraph fmt 
)

Definition at line 207 of file FormattedGraph.cpp.

208{
209 fmt.dump(os);
210 return os;
211}

References fmt().

◆ operator<<() [2/3]

std::ostream & locop::operator<< ( std::ostream &  os,
const Spec< Interface::Formatted > &  formatted 
)

Definition at line 22 of file Interfaces.cpp.

23{
24 formatted.dump(os);
25 return os;
26}
virtual void dump(std::ostream &os) const =0

◆ operator<<() [3/3]

std::ostream & locop::operator<< ( std::ostream &  os,
const NodeDesc d 
)

Definition at line 171 of file FormattedGraph.cpp.

172{
173 assert(d.state() != NodeDesc::State::Invalid);
174
175 std::vector<std::string> values;
176
177 for (uint32_t n = 0; n < d.args().count(); ++n)
178 {
179 values.emplace_back(d.args().at(n).first + ": " + d.args().at(n).second);
180 }
181
182 if (d.state() == NodeDesc::State::PartiallyKnown)
183 {
184 values.emplace_back("...");
185 }
186
187 os << d.opname();
188 os << "(";
189 if (values.size() > 0)
190 {
191 os << values.at(0);
192 for (uint32_t n = 1; n < values.size(); ++n)
193 {
194 os << ", " << values.at(n);
195 }
196 }
197 os << ")";
198
199 return os;
200}
const ArgElem & at(uint32_t n) const
Definition NodeSummary.h:42
const OpName & opname(void) const
const State & state(void) const
const ArgDesc & args(void) const
Definition NodeSummary.h:94

References locop::NodeDesc::Invalid, and locop::NodeDesc::PartiallyKnown.