Compute Library
18.05
|
#include <Graph.h>
Public Member Functions | |
Graph ()=default | |
Graph (GraphID id, std::string name) | |
Constructor. More... | |
Graph (const Graph &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
Graph & | operator= (const Graph &)=delete |
Prevent instances of this class from being copy assigned (As this class contains pointers) More... | |
Graph (Graph &&)=default | |
Allow instances of this class to be moved. More... | |
Graph & | operator= (Graph &&)=default |
Allow instances of this class to be move assigned. More... | |
template<typename NT , typename... Ts> | |
NodeID | add_node (Ts &&...args) |
Adds a node to the graph. More... | |
bool | remove_node (NodeID nid) |
Remove the node with the given ID. More... | |
EdgeID | add_connection (NodeID source, size_t source_idx, NodeID sink, size_t sink_idx) |
Adds a connection between two nodes. More... | |
bool | remove_connection (EdgeID eid) |
Removes an edge (connection) More... | |
std::string | name () const |
Returns graph name. More... | |
GraphID | id () const |
Returns graph id. More... | |
const std::vector< NodeID > & | inputs () |
Returns graph input nodes. More... | |
std::vector< std::unique_ptr< INode > > & | nodes () |
Returns nodes of graph. More... | |
const std::vector< std::unique_ptr< INode > > & | nodes () const |
Returns nodes of graph. More... | |
const std::vector< std::unique_ptr< Edge > > & | edges () const |
Returns edges of graph. More... | |
std::vector< std::unique_ptr< Tensor > > & | tensors () |
Returns tensors of graph. More... | |
const std::vector< std::unique_ptr< Tensor > > & | tensors () const |
Returns tensors of graph. More... | |
const INode * | node (NodeID id) const |
Get node object given its id. More... | |
INode * | node (NodeID id) |
Get node object given its id. More... | |
const Edge * | edge (EdgeID id) const |
Get edge object given its id. More... | |
Edge * | edge (EdgeID id) |
Get edge object given its id. More... | |
const Tensor * | tensor (TensorID id) const |
Get tensor object given its id. More... | |
Tensor * | tensor (TensorID id) |
Get tensor object given its id. More... | |
Graph class.
Represents a multiple source - multiple sink directed graph
|
default |
Prevent instances of this class from being copied (As this class contains pointers)
Adds a connection between two nodes.
[in] | source | ID of the source node |
[in] | source_idx | Output index of the source node |
[in] | sink | ID of the sink node |
[in] | sink_idx | Input index of the sink node |
|
inline |
Adds a node to the graph.
NT | Node operation |
Ts | Arguments to operation |
args | Node arguments |
Definition at line 230 of file Graph.h.
References INode::forward_descriptors(), arm_compute::graph::Input, Graph::node(), INode::set_graph(), INode::set_id(), and INode::type().
Get edge object given its id.
[in] | id | Edge ID |
Referenced by arm_compute::graph::detail::all_inputs_are_visited(), and arm_compute::graph::bfs().
Get edge object given its id.
[in] | id | Edge ID |
const std::vector<std::unique_ptr<Edge> >& edges | ( | ) | const |
Returns edges of graph.
const std::vector<NodeID>& inputs | ( | ) |
Returns graph input nodes.
Referenced by arm_compute::graph::bfs().
std::string name | ( | ) | const |
Returns graph name.
Get node object given its id.
[in] | id | Node ID |
Referenced by Graph::add_node(), arm_compute::graph::bfs(), and BranchLayer::create_layer().
Get node object given its id.
[in] | id | Node ID |
std::vector<std::unique_ptr<INode> >& nodes | ( | ) |
Returns nodes of graph.
Referenced by arm_compute::graph::bfs().
const std::vector<std::unique_ptr<INode> >& nodes | ( | ) | const |
Returns nodes of graph.
Prevent instances of this class from being copy assigned (As this class contains pointers)
bool remove_connection | ( | EdgeID | eid | ) |
Removes an edge (connection)
[in] | eid | Connection to remove |
bool remove_node | ( | NodeID | nid | ) |
Remove the node with the given ID.
[in] | nid | ID of the node to remove |
Get tensor object given its id.
[in] | id | Tensor ID |
Referenced by arm_compute::graph::get_tensor_descriptor().
Get tensor object given its id.
[in] | id | Tensor ID |
std::vector<std::unique_ptr<Tensor> >& tensors | ( | ) |
Returns tensors of graph.
const std::vector<std::unique_ptr<Tensor> >& tensors | ( | ) | const |
Returns tensors of graph.