printGraph method
void
printGraph()
Allows the exact printing of the current compute graph for this GPUTensor. 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 ---
đ GPU Computational Graph:
âââ t_gpu_4 [3] [GPU] (Op: elementWiseMultiplyGPU)
âââ t_gpu_2 [3] [GPU] (Leaf: VRAM Input)
âââ t_gpu_3 [3] [GPU] (Op: addVectorGPU)
âââ t_gpu_0 [3] [GPU] (Leaf: VRAM Input)
âââ t_gpu_1 [3] [GPU] (Leaf: VRAM Input)
For decoding od the CommandBuffer to inspect what gets calculated in what order on the gpu a TapeDecoder can be used:
TapeDecoder(buffer.bytes()).decode();
->
đ --- Decoding Execution Tape (62 bytes) ---
âšī¸ OP_ADD: t_gpu_3 = t_gpu_0 op t_gpu_1
âšī¸ OP_MULTIPLY: t_gpu_4 = t_gpu_2 op t_gpu_3
đ --- End of Tape ---
Implementation
void printGraph() {
Logger.yellow('GPU Computational Graph:', prefix: 'đ');
Set<String> visited = {};
_buildGPUGraphString(this, '', true, visited);
}