← OpenFluke

Chapter 55

stub/grafting

github.com/openfluke/welvet/stub/grafting🚧


Why it exists

Merge grids into Parallel/Residual structures for topology experiments.

What it is

GraftGrids, ResidualGraft, GraftToGrid — Dense branches in v0.

Go example

examples/55-stub-grafting/main.go

Run:cd welvet/examples/55-stub-grafting && source ../env.sh && go run .
package main

import (
	"fmt"

	"github.com/openfluke/welvet/architecture"
	"github.com/openfluke/welvet/layers/parallel"
	"github.com/openfluke/welvet/stub/grafting"
)

func main() {
	a, b := architecture.NewGrid(1, 1, 1, 1), architecture.NewGrid(1, 1, 1, 1)
	out, err := grafting.GraftGrids([]*architecture.Grid{a, b}, parallel.CombineConcat)
	fmt.Println(out != nil, err)
}

Output

Run python3 _gen_welvet_book.py --run to capture output.