Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoMachine ¶
type GoMachine struct {
// contains filtered or unexported fields
}
GoMachine is a computation VM for Gorgonia. Every edge of the graph is associated with a channel of Value. The channels are identified by two IDs, tail and head, which are the IDs of the starting node and the ending node.
Every node with a non-nil Op launches a goroutine.
Each goroutine is expecting Values from all of its input channels (those with a tail matching the current node's ID). Then it calls the Do method of the operator, sets the own node's Value (thanks to the `Let` function), and sends the Value to the output channel (the channels with a head matching the current node'ID).
Every input *Node, sends its Value to the channel with a tail matching its node ID and head matching a constant negative value.
func NewGoMachine ¶
NewGoMachine creates a new VM able to run a program in a concurrent way. by now, only forward pass is supported