Documentation
¶
Index ¶
Constants ¶
const ( CPU_DEVICE = iota + 1 // cpu device type GPU_DEVICE // gpu device type )
Variables ¶
This section is empty.
Functions ¶
func GetLastError ¶
func GetLastError() error
get the last error happeneed. go binding for MXGetLastError
Types ¶
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 ¶
func CreatePredictor(symbol []byte, params []byte, device Device, nodes []InputNode, ) (*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(symbol []byte, params []byte, device Device, nodes []InputNode, outputKey string, ) (*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) 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