Versions in this module Expand all Collapse all v0 v0.0.1 Nov 22, 2022 Changes in this version + type Context struct + func NewContext() *Context + func (ctx *Context) AddDeviceInfo(di *DeviceInfo) + func (ctx *Context) Destroy() + func (ctx *Context) GetEnableParallel() bool + func (ctx *Context) GetThreadAffinityCoreList() []int + func (ctx *Context) GetThreadAffinityMode() ThreadAffinityMode + func (ctx *Context) GetThreadNum() int + func (ctx *Context) SetEnableParallel(enable bool) + func (ctx *Context) SetThreadAffinityCoreList(list []int) + func (ctx *Context) SetThreadAffinityMode(mod ThreadAffinityMode) + func (ctx *Context) SetThreadNum(num int) + type DataType C.MSDataType + const DataTypeInvalid + const DataTypeNumberTypeBegin + const DataTypeNumberTypeBool + const DataTypeNumberTypeEnd + const DataTypeNumberTypeFloat16 + const DataTypeNumberTypeFloat32 + const DataTypeNumberTypeFloat64 + const DataTypeNumberTypeInt16 + const DataTypeNumberTypeInt32 + const DataTypeNumberTypeInt64 + const DataTypeNumberTypeInt8 + const DataTypeNumberTypeUInt16 + const DataTypeNumberTypeUInt32 + const DataTypeNumberTypeUInt64 + const DataTypeNumberTypeUInt8 + const DataTypeObjectTypeList + const DataTypeObjectTypeString + const DataTypeObjectTypeTensor + const DataTypeObjectTypeTuple + const DataTypeUnknown + type DeviceInfo struct + func NewDeviceInfo(typ DeviceType) *DeviceInfo + func (di *DeviceInfo) Destroy() + func (di *DeviceInfo) GetDeviceType() DeviceType + func (di *DeviceInfo) GetEnableFP16() bool + func (di *DeviceInfo) GetFrequency(frequency int) int + func (di *DeviceInfo) GetProvider() string + func (di *DeviceInfo) GetProviderDevice() string + func (di *DeviceInfo) SetEnableFP16(enable bool) + func (di *DeviceInfo) SetFrequency(frequency int) + func (di *DeviceInfo) SetProvider(provider string) + func (di *DeviceInfo) SetProviderDevice(device string) + type DeviceType C.MSDeviceType + const DeviceTypeCPU + const DeviceTypeGPU + const DeviceTypeInvalid + const DeviceTypeKirinNPU + type Format C.MSFormat + const FormatCHWK + const FormatCKHW + const FormatHW + const FormatHW4 + const FormatHWCK + const FormatHWKC + const FormatKCHW + const FormatKHWC + const FormatNC + const FormatNC4 + const FormatNC4HW4 + const FormatNCDHW + const FormatNCHW + const FormatNCW + const FormatNHWC + const FormatNHWC4 + const FormatNWC + type Model struct + func NewModel() *Model + func (mod *Model) Build(modData []byte, modType ModelType, ctx *Context) error + func (mod *Model) BuildFromFile(file string, modType ModelType, ctx *Context) error + func (mod *Model) Destroy() + func (mod *Model) GetInputByTensorName(name string) *Tensor + func (mod *Model) GetInputs() []*Tensor + func (mod *Model) GetOutputByTensorName(name string) *Tensor + func (mod *Model) GetOutputs() []*Tensor + func (mod *Model) Predict(input []*Tensor) []*Tensor + func (mod *Model) Resize(tensors []*Tensor, shapes [][]int) + type ModelType C.MSModelType + const ModelTypeInvalid + const ModelTypeMindIR + type Tensor struct + func NewTensor(name string, dtyp DataType, shape []int, data interface{}) *Tensor + func (tensor *Tensor) DeepClone() *Tensor + func (tensor *Tensor) Destroy() + func (tensor *Tensor) GetData() unsafe.Pointer + func (tensor *Tensor) GetDataType() DataType + func (tensor *Tensor) GetElementNum() int + func (tensor *Tensor) GetFormat() Format + func (tensor *Tensor) GetMutableData() unsafe.Pointer + func (tensor *Tensor) GetName() string + func (tensor *Tensor) GetShape() []int + func (tensor *Tensor) SetData(data interface{}) + func (tensor *Tensor) SetDataType(dtyp DataType) + func (tensor *Tensor) SetFormat(fmt Format) + func (tensor *Tensor) SetName(name string) + func (tensor *Tensor) SetShape(shape ...int) + type TensorArray C.MSTensorHandleArray + func Tensors2TensorArray(tensors []*Tensor) *TensorArray + func (ta TensorArray) ToTensors() []*Tensor + type ThreadAffinityMode C.int + const ThreadAffinityModeBigCoresFirst + const ThreadAffinityModeLittleCoresFirst + const ThreadAffinityModeNoAffinities + type TypeSize uint64 + const TypeSize16 + const TypeSize32 + const TypeSize64 + const TypeSize8 + const TypeSizePtr