Documentation
¶
Overview ¶
Package graph implements a computational graph in GX.
Index ¶
- type Graph
- func (g *Graph) Argument(name string, sh *shape.Shape, index int) (ops.Node, error)
- func (g *Graph) Binary(op *ast.BinaryExpr, x, y ops.Node) (ops.Node, error)
- func (g *Graph) BroadcastInDim(x ops.Node, shape *shape.Shape, broadcastAxes []int) (ops.Node, error)
- func (g *Graph) Call(sg *ops.Subgraph, args ...ops.Node) (ops.Node, error)
- func (g *Graph) Cast(x ops.Node, dt dtype.DataType) (ops.Node, error)
- func (g *Graph) Compile(dev platform.Device, output, traced []*ops.OutputNode, params []*shape.Shape) (ops.Runner, error)
- func (g *Graph) Concat(axis int, nodes []ops.Node) (ops.Node, error)
- func (g *Graph) Constant(value platform.HostBuffer) (ops.Node, error)
- func (g *Graph) Core() ops.CoreBuilder
- func (g *Graph) Cos(x ops.Node) (ops.Node, error)
- func (g *Graph) DotGeneral(x, y ops.Node, batchAxes, reduceAxes [2][]int) (ops.Node, error)
- func (g *Graph) Graph() ops.Graph
- func (g *Graph) Iota(sh *shape.Shape, iotaAxis int) (ops.Node, error)
- func (g *Graph) Math() ops.MathBuilder
- func (g *Graph) Num() ops.NumBuilder
- func (g *Graph) Platform() platform.Platform
- func (g *Graph) Reshape(x ops.Node, axisLengths []int) (ops.Node, error)
- func (g *Graph) Set(x, updates, index ops.Node) (ops.Node, error)
- func (g *Graph) Sin(x ops.Node) (ops.Node, error)
- func (g *Graph) Slice(x ops.Node, index int) (ops.Node, error)
- func (g *Graph) Subgraph(name string, args []*shape.Shape) (ops.Graph, error)
- func (g *Graph) Tanh(x ops.Node) (ops.Node, error)
- func (g *Graph) Tuple(nodes []ops.Node) (ops.Tuple, error)
- func (g *Graph) Unary(op *ast.UnaryExpr, x ops.Node) (ops.Node, error)
- func (g *Graph) While(cond, body *ops.Subgraph, state ops.Node) (ops.Node, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph of the Go native backend.
func (*Graph) BroadcastInDim ¶
func (g *Graph) BroadcastInDim(x ops.Node, shape *shape.Shape, broadcastAxes []int) (ops.Node, error)
BroadcastInDim broadcasts data across a given set of axis.
func (*Graph) Compile ¶
func (g *Graph) Compile(dev platform.Device, output, traced []*ops.OutputNode, params []*shape.Shape) (ops.Runner, error)
Compile the graph for a given device. The graph is not supposed to be modified once it has been compiled.
func (*Graph) Constant ¶
Constant returns a node representing a numerical constant value in the graph.
func (*Graph) Core ¶
func (g *Graph) Core() ops.CoreBuilder
Core returns the builder to build core operations.
func (*Graph) DotGeneral ¶
DotGeneral returns a general dot operator node.
func (*Graph) Iota ¶
Iota returns a node filling an array with values from 0 to number of elements-1.
func (*Graph) Math ¶
func (g *Graph) Math() ops.MathBuilder
Math returns the builder for the math package.
func (*Graph) Num ¶
func (g *Graph) Num() ops.NumBuilder
Num returns the builder for the num package.
Click to show internal directories.
Click to hide internal directories.