17#ifndef __LOCO_IR_GRAPH_H__
18#define __LOCO_IR_GRAPH_H__
29#include <initializer_list>
77 void shape(std::unique_ptr<TensorShape> &&shape) { _shape = std::move(shape); }
78 void shape(std::initializer_list<Dimension> dims);
81 std::unique_ptr<TensorShape> _shape =
nullptr;
90 const std::string &
name(
void)
const {
return _name; }
95#define LOCO_NAMED_ENTITY_EXPOSE using NamedEntity::name
105 public Mixin<Trait::DataTyped>,
106 public Mixin<Trait::TensorShaped>
133 public Mixin<Trait::DataTyped>,
134 public Mixin<Trait::TensorShaped>
183 std::unique_ptr<T> ptr{
new T};
208 _node_ctx.graph(
this);
227 InputContext _input_ctx;
228 OutputContext _output_ctx;
InputContext * inputs(void)
NodeContext * nodes(void)
const InputContext * inputs(void) const
const NodeContext * nodes(void) const
NodePool NodeContext
Node Pool.
Graph(const Graph &)=delete
const OutputContext * outputs(void) const
OutputContext * outputs(void)
Graph-level Output Metadata.
GraphOutputIndex index(void) const
GraphOutput(GraphOutput &&)=delete
GraphOutput(const GraphOutput &)=delete
GraphOutput(uint32_t index)
void dtype(const DataType &value)
const DataType & dtype(void) const
const TensorShape * shape(void) const
void shape(std::unique_ptr< TensorShape > &&shape)
Trait for elements with name.
void name(const std::string &name)
const std::string & name(void) const
Logical unit of computation.
U * take(std::unique_ptr< U > &&o)
Take the ownership of a given object and returns its raw pointer.
std::set< Node * > all_nodes(Graph *)
Enumerate all the nodes in a given graph.
uint32_t GraphOutputIndex
std::vector< Node * > input_nodes(const Graph *)
std::vector< Node * > output_nodes(Graph *)
DataType
"scalar" value type
std::unique_ptr< Graph > make_graph(void)
Dialect Service interface.
GraphInput * create(void)
GraphOutput * create(void)
Object Pool with Simple Factory Method.
virtual ~SimpleFactoryObjectPool()=default
virtual GraphOutputIndex index(const Node *node) const =0
virtual ~GraphOutputIndexQueryService()=default
virtual bool associated(const Node *node) const =0
Check whether a given node is associated with any Graph-level output.