mxnet

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2018 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProfileAllDisable                 = ProfileMode("false")
	ProfileSymbolicOperatorsDisable   = ProfileMode("false")
	ProfileImperativeOperatorsDisable = ProfileMode("false")
	ProfileMemoryDisable              = ProfileMode("false")
	ProfileApiDisable                 = ProfileMode("false")
	ProfileContinuousDumpDisable      = ProfileMode("false")
	ProfileAllEnable                  = ProfileMode("true")
	ProfileSymbolicOperatorsEnable    = ProfileMode("true")
	ProfileImperativeOperatorsEnable  = ProfileMode("true")
	ProfileMemoryEnable               = ProfileMode("true")
	ProfileApiEnable                  = ProfileMode("true")
	ProfileContinuousDumpEnable       = ProfileMode("true")
)

profile options

Functions

func GetLastError

func GetLastError() error

get the last error happeneed. go binding for MXGetLastError

func WaitAll added in v0.4.0

func WaitAll() error

Types

type DeviceType added in v0.3.13

type DeviceType int
const (
	CPU_DEVICE DeviceType = iota + 1 // cpu device type
	GPU_DEVICE                       // gpu device type
)

type Graph added in v0.4.0

type Graph struct {
	Nodes      []GraphNode            `json:"nodes"`
	ArgNodes   []int                  `json:"arg_nodes"`
	NodeRowPtr []int                  `json:"node_row_ptr"`
	Heads      [][]int                `json:"heads"`
	Attributes map[string]interface{} `json:"attrs"`
	// contains filtered or unexported fields
}

func NewGraph added in v0.4.0

func NewGraph(symbolPath string) (*Graph, error)

func (Graph) ID added in v0.4.0

func (g Graph) ID() int64

func (*Graph) TopologicallySortedNodes added in v0.4.0

func (g *Graph) TopologicallySortedNodes() ([]GraphNode, error)

type GraphNode added in v0.4.0

type GraphNode struct {
	Op         string                 `json:"op"`
	Name       string                 `json:"name"`
	Inputs     [][]int64              `json:"inputs"`
	Attributes map[string]interface{} `json:"param,omitempty"`
	// contains filtered or unexported fields
}

func (GraphNode) ID added in v0.4.0

func (nd GraphNode) ID() int64

type NDItem

type NDItem struct {
	Key   string    // name of ndarray
	Data  []float32 // actual data of ndarray
	Shape []uint32  // shape
	Ndim  uint32    // the number of dimension in the shape
	Size  uint32    // Shape[0]*Shape[1]....Shape[Ndim-1]
}

NDArray operator

type NDList

type NDList struct {
	// contains filtered or unexported fields
}

NDArray List operator

func CreateNDListFromBytes

func CreateNDListFromBytes(b []byte) (*NDList, error)

create NDList from bytes go binding for MXNDListCreate MXNDListCreate will load ndarrays from file data

func CreateNDListFromFile

func CreateNDListFromFile(filepath string) (*NDList, error)

create NDList from file go binding for MXNDListCreate MXNDListCreate will load ndarrays from file data

func (*NDList) Free

func (s *NDList) Free() error

free this NDList's C handle go binding for MXNDListFree

func (*NDList) Get

func (s *NDList) Get(index uint32) (*NDItem, error)

get an element from ndarray list go binding for MXNDListGet

type Predictor

type Predictor struct {
	// contains filtered or unexported fields
}

predictor for inference

func New added in v0.4.0

func New(ctx context.Context, opts ...options.Option) (*Predictor, error)

Create a Predictor go binding for MXPredCreate param symbol The JSON string of the symbol param params In-memory raw bytes of parameter ndarray file param device Device to run predictor param nodes An array of InputNode which stored the name and shape data of ndarray item

func (*Predictor) Close added in v0.3.13

func (p *Predictor) Close() error

free this predictor's C handle go binding for MXPredFree

func (*Predictor) Forward

func (p *Predictor) Forward() error

run a forward pass after SetInput go binding for MXPredForward

func (*Predictor) GetOutputShape

func (p *Predictor) GetOutputShape(index int) ([]int, error)

get the shape of output node go binding for MXPredGetOutputShape param index The index of output node, set to 0 if there is only one output

func (*Predictor) Predict added in v0.4.0

func (p *Predictor) Predict(ctx context.Context, data []float32) error

func (*Predictor) ReadPredictionOutput added in v0.4.0

func (p *Predictor) ReadPredictionOutput(ctx context.Context) ([]float32, error)

get the output of the prediction index is the index of the output node, set to 0 assuming there is only one output

func (*Predictor) SetInput

func (p *Predictor) SetInput(key string, data []float32) error

set the input data of predictor go binding for MXPredSetInput param key The name of input node to set param data The float data to be set

type Profile added in v0.3.12

type Profile struct {
	Trace *chrome.Trace
	// contains filtered or unexported fields
}

func NewProfile added in v0.3.12

func NewProfile(profileOptions map[string]ProfileMode, tmpDir string) (*Profile, error)

go binding for MXSetProfilerConfig() param profile_options map of profiling options param tmpDir output filepath

func (*Profile) Delete added in v0.3.12

func (p *Profile) Delete() error

func (*Profile) Dump added in v0.3.12

func (p *Profile) Dump(finished bool) (string, error)

go binding for MXDumpProfile()

func (*Profile) Pause added in v0.4.0

func (p *Profile) Pause() error

go binding for MXProfilePause(1)

func (*Profile) Publish added in v0.3.12

func (p *Profile) Publish(ctx context.Context, opts ...opentracing.StartSpanOption) error

func (*Profile) Read added in v0.3.12

func (p *Profile) Read() error

func (*Profile) Resume added in v0.4.0

func (p *Profile) Resume() error

go binding for MXProfilePause(0)

func (*Profile) Start added in v0.3.12

func (p *Profile) Start() error

go binding for MXSetProfilerState(1)

func (*Profile) Stop added in v0.3.12

func (p *Profile) Stop() error

go binding for MXSetProfilerState(0)

func (*Profile) String added in v0.3.12

func (p *Profile) String() (string, error)

type ProfileMode added in v0.3.12

type ProfileMode string

profile type

Jump to

Keyboard shortcuts

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