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);
}