Documentation ¶
Index ¶
- Constants
- func GetLastError() error
- type DeviceType
- type NDItem
- type NDList
- type Predictor
- type Profile
- func (p *Profile) Delete() error
- func (p *Profile) Dump(finished bool) (string, error)
- func (p *Profile) Publish(ctx context.Context, opts ...opentracing.StartSpanOption) error
- func (p *Profile) Read() error
- func (p *Profile) Start() error
- func (p *Profile) Stop() error
- func (p *Profile) String() (string, error)
- type ProfileMode
Constants ¶
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 ¶
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 CreatePredictor ¶
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 ¶
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) GetOutput ¶
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 ¶
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
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