printGraph method
void
printGraph()
Allows the exact printing of the current compute graph for this Tensor. Topological Depth is indicated via indents.
Colors indicate tensor types. Green is indication of an input Tensor, blue an intermediate Tensor and Yellow the resulting output of the Network.
Tensor name and shape are listed as t_tensorid [1,4,5,...]
Example for a simple neuronal network:
--- Inspecting Computational Graph ---
📊 Computational Graph [Hybrid CPU/GPU]:
└── t_180019 [] [CPU] (Op: mse_vector)
├── t_180018 [1] [CPU] (Op: sigmoid_vector)
│ └── t_180017 [1] [CPU] (Op: add_vector)
│ ├── t_180016 [1] [CPU] (Op: matVecMul)
│ │ ├── t_6 [1, 8] [CPU] (Leaf: Input)
│ │ └── t_180015 [8] [CPU] (Op: relu_vector)
│ │ └── t_180014 [8] [CPU] (Op: add_vector)
│ │ ├── t_180013 [8] [CPU] (Op: matVecMul)
│ │ │ ├── t_1 [8, 2] [CPU] (Leaf: Input)
│ │ │ └── t_180011 [2] [CPU] (Leaf: Input)
│ │ └── t_2 [8] [CPU] (Leaf: Input)
│ └── t_7 [1] [CPU] (Leaf: Input)
└── t_180012 [1] [CPU] (Leaf: Input)
Implementation
void printGraph() {
Logger.yellow('Computational Graph [Hybrid CPU/GPU]:', prefix: '📊');
Set<String> visitedTensors = {};
_buildGraphString(this, '', true, visitedTensors, true);
}