onnx

package
v0.0.0-...-d437eb7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2019 License: NCSA Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPrunedLayerTypes = []string{
	"identity",
	"Relu",
	"mul",
	"concat",
	"maxpool",
	"sum",
	"reshape",
	"pRelu",
	"gemm",
	"dropout",
	"averagepool",
	"transpose",
	"globalaveragepool",
	"lrn",
	"leakyRelu",
	"matmul",
	"imagescaler",
	"unsqueeze",
	"sub",
	"identity",
}

Functions

This section is empty.

Types

type DominatorTree

type DominatorTree struct {
	flow.DominatorTree
}

A DominatorTree represents a dominator tree.

func (DominatorTree) Dominated

func (dt DominatorTree) Dominated(a, b graph.Node) bool

func (DominatorTree) Dominates

func (dt DominatorTree) Dominates(a, b graph.Node) bool

Dominates reports whether A dominates B.

type Graph

type Graph struct {
	Root *GraphNode

	*simple.WeightedDirectedGraph
	// contains filtered or unexported fields
}

func (Graph) DOTAttributers

func (g Graph) DOTAttributers() (graph, node, edge encoding.Attributer)

func (Graph) Dominators

func (grph Graph) Dominators() DominatorTree

func (Graph) FindSubGraphs

func (grph Graph) FindSubGraphs() ([]Graph, error)

func (Graph) Prune

func (g Graph) Prune(layerTypes []string) *Graph

func (Graph) TopologicallyOrderedNodes

func (g Graph) TopologicallyOrderedNodes() (GraphNodes, error)

type GraphEdge

type GraphEdge struct {
	graph.WeightedEdge
	// contains filtered or unexported fields
}

func (GraphEdge) Attributes

func (nd GraphEdge) Attributes() []encoding.Attribute

func (GraphEdge) Color

func (nd GraphEdge) Color() color.Color

func (*GraphEdge) Highlight

func (nd *GraphEdge) Highlight()

func (*GraphEdge) SetColor

func (nd *GraphEdge) SetColor(clr color.Color)

type GraphNode

type GraphNode struct {
	*onnx.NodeProto
	// contains filtered or unexported fields
}

func (GraphNode) Attributes

func (nd GraphNode) Attributes() []encoding.Attribute

func (*GraphNode) Benchmarks

func (nd *GraphNode) Benchmarks() benchmark.Benchmarks

func (GraphNode) DOTID

func (nd GraphNode) DOTID() string

func (GraphNode) GetRuntime

func (nd GraphNode) GetRuntime() *time.Duration

func (GraphNode) ID

func (nd GraphNode) ID() int64

func (GraphNode) Layer

func (nd GraphNode) Layer() dlperf.Layer

func (*GraphNode) SetBenchmarks

func (nd *GraphNode) SetBenchmarks(bs benchmark.Benchmarks)

func (*GraphNode) SetID

func (nd *GraphNode) SetID(id int64)

func (*GraphNode) SetRuntime

func (nd *GraphNode) SetRuntime(t time.Duration)

type GraphNodes

type GraphNodes []*GraphNode

type GraphOption

type GraphOption func(*GraphOptions)

func GraphInputsAsConstantNodes

func GraphInputsAsConstantNodes(b bool) GraphOption

func GraphPruneInputs

func GraphPruneInputs(b bool) GraphOption

type GraphOptions

type GraphOptions struct {
	PruneInputs           bool
	InputsAsConstantNodes bool
}

func NewGraphOptions

func NewGraphOptions(oo ...GraphOption) GraphOptions

type Onnx

type Onnx struct {
	*onnx.ModelProto
	*onnx.GraphProto
	// contains filtered or unexported fields
}

func New

func New(protoFileName string, batchSize int64) (*Onnx, error)

func (Onnx) BatchSize

func (o Onnx) BatchSize() int64

func (Onnx) Dominators

func (o Onnx) Dominators() DominatorTree

func (Onnx) FindSubGraphs

func (o Onnx) FindSubGraphs() ([]Graph, error)

func (Onnx) FlopsInformation

func (o Onnx) FlopsInformation() dlperf.FlopsInformation

func (Onnx) GetValueInfoDimensions

func (o Onnx) GetValueInfoDimensions(names []string) []dlperf.Shape

func (*Onnx) Information

func (o *Onnx) Information() ([]dlperf.LayerInformation, error)

func (Onnx) MemoryInformation

func (o Onnx) MemoryInformation() dlperf.MemoryInformation

func (Onnx) Network

func (o Onnx) Network() *Graph

func (Onnx) NodeSubsequences

func (o Onnx) NodeSubsequences(oo ...PatternOption) (Patterns, error)

func (Onnx) Show

func (o Onnx) Show()

func (Onnx) String

func (o Onnx) String() string

func (*Onnx) ToGraph

func (o *Onnx) ToGraph(oo ...GraphOption) *Graph

func (Onnx) TopologicallyOrderedNodes

func (o Onnx) TopologicallyOrderedNodes(oo ...GraphOption) (GraphNodes, error)

type Pattern

type Pattern struct {
	Nodes       GraphNodes
	Occurrences int64
}

func (Pattern) HashKey

func (p Pattern) HashKey() string

type PatternOption

type PatternOption func(*PatternOptions)

func PatternLength

func PatternLength(i int) PatternOption

func PatternPruneGraph

func PatternPruneGraph(b bool) PatternOption

func PatternPruneGraphLayers

func PatternPruneGraphLayers(s []string) PatternOption

type PatternOptions

type PatternOptions struct {
	PruneGraph       bool
	PruneGraphLayers []string
	Length           int
}

func NewPatternOptions

func NewPatternOptions(oo ...PatternOption) PatternOptions

type Patterns

type Patterns []Pattern

func NodeSubsequences

func NodeSubsequences(models []*Onnx, oo ...PatternOption) (Patterns, error)

func (Patterns) Counts

func (pats Patterns) Counts() Patterns

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址