Documentation ¶
Index ¶
- Variables
- func GetLastError() error
- func WaitAll() error
- type DeviceType
- type Graph
- type GraphNode
- type NDItem
- type NDList
- type Predictor
- func (p *Predictor) Close() error
- func (p *Predictor) Forward() error
- func (p *Predictor) GetOutputShape(index int) ([]int, error)
- func (p *Predictor) Predict(ctx context.Context, data []float32) error
- func (p *Predictor) ReadPredictionOutput(ctx context.Context) ([]float32, error)
- func (p *Predictor) SetInput(key string, data []float32) error
- type Profile
- func (p *Profile) Delete() error
- func (p *Profile) Dump(finished bool) (string, error)
- func (p *Profile) Pause() error
- func (p *Profile) Publish(ctx context.Context, opts ...opentracing.StartSpanOption) error
- func (p *Profile) Read() error
- func (p *Profile) Resume() error
- func (p *Profile) Start() error
- func (p *Profile) Stop() error
- func (p *Profile) String() (string, error)
- type ProfileMode
Constants ¶
This section is empty.
Variables ¶
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
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 (*Graph) TopologicallySortedNodes ¶ added in v0.4.0
type GraphNode ¶ added in v0.4.0
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 ¶
create NDList from bytes go binding for MXNDListCreate MXNDListCreate will load ndarrays from file data
func CreateNDListFromFile ¶
create NDList from file go binding for MXNDListCreate MXNDListCreate will load ndarrays from file data
type Predictor ¶
type Predictor struct {
// contains filtered or unexported fields
}
predictor for inference
func New ¶ added in v0.4.0
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) GetOutputShape ¶
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) ReadPredictionOutput ¶ added in v0.4.0
get the output of the prediction index is the index of the output node, set to 0 assuming there is only one output
type Profile ¶ added in v0.3.12
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) Publish ¶ added in v0.3.12
func (p *Profile) Publish(ctx context.Context, opts ...opentracing.StartSpanOption) error