41 [[nodiscard]]
NodeId id()
const {
return id_; }
43 [[nodiscard]]
const Shape&
shape()
const {
return shape_; }
44 [[nodiscard]]
const std::optional<std::string>&
label()
const {
return label_; }
47 [[nodiscard]]
const std::vector<Node*>&
parents()
const {
return parents_; }
50 [[nodiscard]]
const std::vector<Node*>&
children()
const {
return children_; }
62 std::optional<std::string> label_;
63 std::vector<Node*> parents_;
64 std::vector<Node*> children_;
A single computation graph node. Owned exclusively by its ComputationGraph (see computation_graph....
Definition node.hpp:29
const std::vector< Node * > & parents() const
This node's parent nodes (edges point from parent to this node).
Definition node.hpp:47
const Shape & shape() const
Definition node.hpp:43
const std::vector< Node * > & children() const
This node's child nodes.
Definition node.hpp:50
void add_child(Node *child)
Registers child as a child of this node. Non-owning; child must outlive this node.
Definition node.hpp:56
OpType op_type() const
Definition node.hpp:42
const std::optional< std::string > & label() const
Definition node.hpp:44
void add_parent(Node *parent)
Registers parent as a parent of this node. Non-owning; parent must outlive this node.
Definition node.hpp:53
Node(NodeId id, OpType op_type, Shape shape, std::optional< std::string > label=std::nullopt)
Constructs a node.
Definition node.hpp:38
NodeId id() const
Definition node.hpp:41
An N-dimensional shape. A plain aggregate of dimensions with no invariant beyond "non-negative dimens...
Definition shape.hpp:24
Definition acquisition_functions.hpp:16
size_t NodeId
Stable identifier for a Node within its owning ComputationGraph.
Definition node.hpp:18
OpType
The op-type tag a Node carries. Charter Part 2 §3: nodes are tagged by a small closed set of op types...
Definition op_type.hpp:19
Closed set of operation categories every graph Node is tagged with.
Tensor dimension arithmetic – rank, element count, per-dimension access.