Documentation ¶
Index ¶
- type 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
- type 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
- type Format
- type 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
- type 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
- type ThreadAffinityMode
- type TypeSize
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func NewContext() *Context
func (*Context) AddDeviceInfo ¶
func (ctx *Context) AddDeviceInfo(di *DeviceInfo)
func (*Context) GetEnableParallel ¶
func (*Context) GetThreadAffinityCoreList ¶
func (*Context) GetThreadAffinityMode ¶
func (ctx *Context) GetThreadAffinityMode() ThreadAffinityMode
func (*Context) GetThreadNum ¶
func (*Context) SetEnableParallel ¶
func (*Context) SetThreadAffinityCoreList ¶
func (*Context) SetThreadAffinityMode ¶
func (ctx *Context) SetThreadAffinityMode(mod ThreadAffinityMode)
func (*Context) SetThreadNum ¶
type DataType ¶
type DataType C.MSDataType
const ( DataTypeUnknown DataType = C.kMSDataTypeUnknown DataTypeObjectTypeString DataType = C.kMSDataTypeObjectTypeString DataTypeObjectTypeList DataType = C.kMSDataTypeObjectTypeList DataTypeObjectTypeTuple DataType = C.kMSDataTypeObjectTypeTuple DataTypeObjectTypeTensor DataType = C.kMSDataTypeObjectTypeTensor DataTypeNumberTypeBegin DataType = C.kMSDataTypeNumberTypeBegin DataTypeNumberTypeBool DataType = C.kMSDataTypeNumberTypeBool DataTypeNumberTypeInt8 DataType = C.kMSDataTypeNumberTypeInt8 DataTypeNumberTypeInt16 DataType = C.kMSDataTypeNumberTypeInt16 DataTypeNumberTypeInt32 DataType = C.kMSDataTypeNumberTypeInt32 DataTypeNumberTypeInt64 DataType = C.kMSDataTypeNumberTypeInt64 DataTypeNumberTypeUInt8 DataType = C.kMSDataTypeNumberTypeUInt8 DataTypeNumberTypeUInt16 DataType = C.kMSDataTypeNumberTypeUInt16 DataTypeNumberTypeUInt32 DataType = C.kMSDataTypeNumberTypeUInt32 DataTypeNumberTypeUInt64 DataType = C.kMSDataTypeNumberTypeUInt64 DataTypeNumberTypeFloat16 DataType = C.kMSDataTypeNumberTypeFloat16 DataTypeNumberTypeFloat32 DataType = C.kMSDataTypeNumberTypeFloat32 DataTypeNumberTypeFloat64 DataType = C.kMSDataTypeNumberTypeFloat64 DataTypeNumberTypeEnd DataType = C.kMSDataTypeNumberTypeEnd DataTypeInvalid DataType = C.kMSDataTypeInvalid )
type DeviceInfo ¶
type DeviceInfo struct {
// contains filtered or unexported fields
}
func NewDeviceInfo ¶
func NewDeviceInfo(typ DeviceType) *DeviceInfo
func (*DeviceInfo) Destroy ¶
func (di *DeviceInfo) Destroy()
func (*DeviceInfo) GetDeviceType ¶
func (di *DeviceInfo) GetDeviceType() DeviceType
func (*DeviceInfo) GetEnableFP16 ¶
func (di *DeviceInfo) GetEnableFP16() bool
func (*DeviceInfo) GetFrequency ¶
func (di *DeviceInfo) GetFrequency(frequency int) int
func (*DeviceInfo) GetProvider ¶
func (di *DeviceInfo) GetProvider() string
func (*DeviceInfo) GetProviderDevice ¶
func (di *DeviceInfo) GetProviderDevice() string
func (*DeviceInfo) SetEnableFP16 ¶
func (di *DeviceInfo) SetEnableFP16(enable bool)
func (*DeviceInfo) SetFrequency ¶
func (di *DeviceInfo) SetFrequency(frequency int)
func (*DeviceInfo) SetProvider ¶
func (di *DeviceInfo) SetProvider(provider string)
func (*DeviceInfo) SetProviderDevice ¶
func (di *DeviceInfo) SetProviderDevice(device string)
type DeviceType ¶
type DeviceType C.MSDeviceType
const ( DeviceTypeCPU DeviceType = C.kMSDeviceTypeCPU DeviceTypeGPU DeviceType = C.kMSDeviceTypeGPU DeviceTypeKirinNPU DeviceType = C.kMSDeviceTypeKirinNPU DeviceTypeInvalid DeviceType = C.kMSDeviceTypeInvalid )
type Format ¶
const ( FormatNCHW Format = C.kMSFormatNCHW FormatNHWC Format = C.kMSFormatNHWC FormatNHWC4 Format = C.kMSFormatNHWC4 FormatHWKC Format = C.kMSFormatHWKC FormatHWCK Format = C.kMSFormatHWCK FormatKCHW Format = C.kMSFormatKCHW FormatCKHW Format = C.kMSFormatCKHW FormatKHWC Format = C.kMSFormatKHWC FormatCHWK Format = C.kMSFormatCHWK FormatHW Format = C.kMSFormatHW FormatHW4 Format = C.kMSFormatHW4 FormatNC Format = C.kMSFormatNC FormatNC4 Format = C.kMSFormatNC4 FormatNC4HW4 Format = C.kMSFormatNC4HW4 FormatNCDHW Format = C.kMSFormatNCDHW FormatNWC Format = C.kMSFormatNWC FormatNCW Format = C.kMSFormatNCW )
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) BuildFromFile ¶
func (*Model) GetInputByTensorName ¶
func (*Model) GetOutputByTensorName ¶
func (*Model) GetOutputs ¶
type ModelType ¶
type ModelType C.MSModelType
const ( ModelTypeMindIR ModelType = C.kMSModelTypeMindIR ModelTypeInvalid ModelType = C.kMSModelTypeInvalid )
type Tensor ¶
type Tensor struct {
// contains filtered or unexported fields
}
func (*Tensor) GetDataType ¶
func (*Tensor) GetElementNum ¶
func (*Tensor) GetMutableData ¶
func (*Tensor) SetDataType ¶
type TensorArray ¶
type TensorArray C.MSTensorHandleArray
func Tensors2TensorArray ¶
func Tensors2TensorArray(tensors []*Tensor) *TensorArray
func (TensorArray) ToTensors ¶
func (ta TensorArray) ToTensors() []*Tensor
type ThreadAffinityMode ¶
const ( ThreadAffinityModeNoAffinities ThreadAffinityMode = 0 ThreadAffinityModeBigCoresFirst ThreadAffinityMode = 1 ThreadAffinityModeLittleCoresFirst ThreadAffinityMode = 2 )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.