mxnet

package
v0.3.14 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProfileAllDisable                 = ProfileMode(0)
	ProfileSymbolicOperatorsDisable   = ProfileMode(0)
	ProfileImperativeOperatorsDisable = ProfileMode(0)
	ProfileMemoryDisable              = ProfileMode(0)
	ProfileApiDisable                 = ProfileMode(0)
	ProfileContiguousDumpDisable      = ProfileMode(0)
	ProfileAllEnable                  = ProfileMode(1)
	ProfileSymbolicOperatorsEnable    = ProfileMode(1)
	ProfileImperativeOperatorsEnable  = ProfileMode(1)
	ProfileMemoryEnable               = ProfileMode(1)
	ProfileApiEnable                  = ProfileMode(1)
	ProfileContiguousDumpEnable       = ProfileMode(1)
	ProfileDumpPeriod                 = ProfileMode(1)
)

profile options

Variables

This section is empty.

Functions

func GetLastError

func GetLastError() error

get the last error happeneed. go binding for MXGetLastError

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 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 CreatePredictor

func CreatePredictor(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 CreatePredictorPartial

func CreatePredictorPartial(opts ...options.Option) (*Predictor, error)

CreatePredictorPartial Creates a Predictor wich customized outputs [layer] 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 param outputKey the name of the output layer/key

func (*Predictor) Close added in v0.3.13

func (s *Predictor) Close() error

free this predictor's C handle go binding for MXPredFree

func (*Predictor) Forward

func (s *Predictor) Forward() error

run a forward pass after SetInput go binding for MXPredForward

func (*Predictor) GetOutput

func (s *Predictor) GetOutput(index uint32) ([]float32, error)

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

func (*Predictor) GetOutputShape

func (s *Predictor) GetOutputShape(index uint32) ([]uint32, 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) SetInput

func (s *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) 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) 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