Documentation
¶
Overview ¶
Package coreml provides purego-based Go bindings for the macOS CoreML framework.
Apple documentation: https://developer.apple.com/documentation/coreml
Index ¶
- func MLAllComputeDevices() *foundation.NSArray[MLComputeDeviceProtocol]
- func MLComputePlanLoadContentsOfURLConfigurationCompletionHandler(url *foundation.NSURL, configuration *MLModelConfiguration, ...)
- func MLComputePlanLoadModelAssetConfigurationCompletionHandler(asset *MLModelAsset, configuration *MLModelConfiguration, ...)
- func MLFeatureValueImageOptionCropAndScale() *foundation.NSString
- func MLFeatureValueImageOptionCropRect() *foundation.NSString
- func MLModelAuthorKey() *foundation.NSString
- func MLModelAvailableComputeDevices() *foundation.NSArray[MLComputeDeviceProtocol]
- func MLModelCompileModelAtURLCompletionHandler(modelURL *foundation.NSURL, handler func(*foundation.NSURL, unsafe.Pointer))
- func MLModelCompileModelAtURLError(modelURL *foundation.NSURL) (*foundation.NSURL, error)
- func MLModelCreatorDefinedKey() *foundation.NSString
- func MLModelDescriptionKey() *foundation.NSString
- func MLModelErrorDomain() uintptr
- func MLModelLicenseKey() *foundation.NSString
- func MLModelLoadContentsOfURLConfigurationCompletionHandler(url *foundation.NSURL, configuration *MLModelConfiguration, ...)
- func MLModelLoadModelAssetConfigurationCompletionHandler(asset *MLModelAsset, configuration *MLModelConfiguration, ...)
- func MLModelStructureLoadContentsOfURLCompletionHandler(url *foundation.NSURL, handler func(*MLModelStructure, unsafe.Pointer))
- func MLModelStructureLoadModelAssetCompletionHandler(asset *MLModelAsset, handler func(*MLModelStructure, unsafe.Pointer))
- func MLModelVersionStringKey() *foundation.NSString
- func SymbolAvailable(symbol string) bool
- type Acl_entry_id_t
- type Acl_flag_t
- type Acl_perm_t
- type Acl_tag_t
- type Acl_type_t
- type Clockid_t
- type Dispatch_autorelease_frequency_t
- type Dispatch_block_flags_t
- type EvCmd
- type Filesec_property_t
- type Idtype_t
- type Ipc_info_object_type_t
- type Launch_data_type_t
- type MDLabelDomain
- type MDQueryOptionFlags
- type MDQuerySortOptionFlags
- type MLArrayBatchProvider
- func (o *MLArrayBatchProvider) Array() *foundation.NSArray[MLFeatureProvider]
- func (o *MLArrayBatchProvider) InitWithDictionaryError(dictionary *foundation.NSDictionary[*foundation.NSString, objc.ID]) (*MLArrayBatchProvider, error)
- func (o *MLArrayBatchProvider) InitWithFeatureProviderArray(array *foundation.NSArray[MLFeatureProvider]) *MLArrayBatchProvider
- type MLBatchProvider
- type MLCPUComputeDevice
- type MLComputeDeviceProtocol
- type MLComputePlan
- func (o *MLComputePlan) ComputeDeviceUsageForMLProgramOperation(operation *MLModelStructureProgramOperation) *MLComputePlanDeviceUsage
- func (o *MLComputePlan) ComputeDeviceUsageForNeuralNetworkLayer(layer *MLModelStructureNeuralNetworkLayer) *MLComputePlanDeviceUsage
- func (o *MLComputePlan) EstimatedCostOfMLProgramOperation(operation *MLModelStructureProgramOperation) *MLComputePlanCost
- func (o *MLComputePlan) ModelStructure() *MLModelStructure
- type MLComputePlanCost
- type MLComputePlanDeviceUsage
- type MLComputeUnits
- type MLCustomLayer
- type MLCustomModel
- type MLDictionaryConstraint
- type MLDictionaryFeatureProvider
- func (o *MLDictionaryFeatureProvider) Dictionary() *foundation.NSDictionary[*foundation.NSString, *MLFeatureValue]
- func (o *MLDictionaryFeatureProvider) InitWithDictionaryError(dictionary *foundation.NSDictionary[*foundation.NSString, objc.ID]) (*MLDictionaryFeatureProvider, error)
- func (o *MLDictionaryFeatureProvider) ObjectForKeyedSubscript(featureName *foundation.NSString) *MLFeatureValue
- type MLFeatureDescription
- func (o *MLFeatureDescription) DictionaryConstraint() *MLDictionaryConstraint
- func (o *MLFeatureDescription) ImageConstraint() *MLImageConstraint
- func (o *MLFeatureDescription) IsAllowedValue(value *MLFeatureValue) bool
- func (o *MLFeatureDescription) IsOptional() bool
- func (o *MLFeatureDescription) MultiArrayConstraint() *MLMultiArrayConstraint
- func (o *MLFeatureDescription) Name() *foundation.NSString
- func (o *MLFeatureDescription) SequenceConstraint() *MLSequenceConstraint
- func (o *MLFeatureDescription) StateConstraint() *MLStateConstraint
- func (o *MLFeatureDescription) Type() MLFeatureType
- type MLFeatureProvider
- type MLFeatureType
- type MLFeatureValue
- func MLFeatureValueFeatureValueWithCGImageConstraintOptionsError(cgImage unsafe.Pointer, constraint *MLImageConstraint, ...) (*MLFeatureValue, error)
- func MLFeatureValueFeatureValueWithCGImageOrientationConstraintOptionsError(cgImage unsafe.Pointer, orientation imageio.CGImagePropertyOrientation, ...) (*MLFeatureValue, error)
- func MLFeatureValueFeatureValueWithCGImageOrientationPixelsWidePixelsHighPixelFormatTypeOptionsError(cgImage unsafe.Pointer, orientation imageio.CGImagePropertyOrientation, ...) (*MLFeatureValue, error)
- func MLFeatureValueFeatureValueWithCGImagePixelsWidePixelsHighPixelFormatTypeOptionsError(cgImage unsafe.Pointer, pixelsWide int, pixelsHigh int, pixelFormatType uint, ...) (*MLFeatureValue, error)
- func MLFeatureValueFeatureValueWithDictionaryError(value *foundation.NSDictionary[objc.ID, *foundation.NSNumber]) (*MLFeatureValue, error)
- func MLFeatureValueFeatureValueWithDouble(value float64) *MLFeatureValue
- func MLFeatureValueFeatureValueWithImageAtURLConstraintOptionsError(url *foundation.NSURL, constraint *MLImageConstraint, ...) (*MLFeatureValue, error)
- func MLFeatureValueFeatureValueWithImageAtURLOrientationConstraintOptionsError(url *foundation.NSURL, orientation imageio.CGImagePropertyOrientation, ...) (*MLFeatureValue, error)
- func MLFeatureValueFeatureValueWithImageAtURLOrientationPixelsWidePixelsHighPixelFormatTypeOptionsError(url *foundation.NSURL, orientation imageio.CGImagePropertyOrientation, ...) (*MLFeatureValue, error)
- func MLFeatureValueFeatureValueWithImageAtURLPixelsWidePixelsHighPixelFormatTypeOptionsError(url *foundation.NSURL, pixelsWide int, pixelsHigh int, pixelFormatType uint, ...) (*MLFeatureValue, error)
- func MLFeatureValueFeatureValueWithInt64(value int64) *MLFeatureValue
- func MLFeatureValueFeatureValueWithMultiArray(value *MLMultiArray) *MLFeatureValue
- func MLFeatureValueFeatureValueWithPixelBuffer(value unsafe.Pointer) *MLFeatureValue
- func MLFeatureValueFeatureValueWithSequence(sequence *MLSequence) *MLFeatureValue
- func MLFeatureValueFeatureValueWithString(value *foundation.NSString) *MLFeatureValue
- func MLFeatureValueFromID(id objc.ID) *MLFeatureValue
- func MLFeatureValueUndefinedFeatureValueWithType(type_ MLFeatureType) *MLFeatureValue
- func (o *MLFeatureValue) DictionaryValue() *foundation.NSDictionary[objc.ID, *foundation.NSNumber]
- func (o *MLFeatureValue) DoubleValue() float64
- func (o *MLFeatureValue) ImageBufferValue() unsafe.Pointer
- func (o *MLFeatureValue) Int64Value() int64
- func (o *MLFeatureValue) IsEqualToFeatureValue(value *MLFeatureValue) bool
- func (o *MLFeatureValue) IsUndefined() bool
- func (o *MLFeatureValue) MultiArrayValue() *MLMultiArray
- func (o *MLFeatureValue) SequenceValue() *MLSequence
- func (o *MLFeatureValue) StringValue() *foundation.NSString
- func (o *MLFeatureValue) Type() MLFeatureType
- type MLGPUComputeDevice
- type MLImageConstraint
- type MLImageSize
- type MLImageSizeConstraint
- type MLImageSizeConstraintType
- type MLKey
- type MLMetricKey
- type MLModel
- func (o *MLModel) Configuration() *MLModelConfiguration
- func (o *MLModel) ModelDescription() *MLModelDescription
- func (o *MLModel) NewState() *MLState
- func (o *MLModel) ParameterValueForKeyError(key *MLParameterKey) (objc.ID, error)
- func (o *MLModel) PredictionFromFeaturesCompletionHandler(input MLFeatureProvider, completionHandler func(objc.ID, unsafe.Pointer))
- func (o *MLModel) PredictionFromFeaturesError(input MLFeatureProvider) (MLFeatureProvider, error)
- func (o *MLModel) PredictionFromFeaturesOptionsCompletionHandler(input MLFeatureProvider, options *MLPredictionOptions, ...)
- func (o *MLModel) PredictionFromFeaturesOptionsError(input MLFeatureProvider, options *MLPredictionOptions) (MLFeatureProvider, error)
- func (o *MLModel) PredictionFromFeaturesUsingStateError(inputFeatures MLFeatureProvider, state *MLState) (MLFeatureProvider, error)
- func (o *MLModel) PredictionFromFeaturesUsingStateOptionsCompletionHandler(inputFeatures MLFeatureProvider, state *MLState, options *MLPredictionOptions, ...)
- func (o *MLModel) PredictionFromFeaturesUsingStateOptionsError(inputFeatures MLFeatureProvider, state *MLState, options *MLPredictionOptions) (MLFeatureProvider, error)
- func (o *MLModel) PredictionsFromBatchError(inputBatch MLBatchProvider) (MLBatchProvider, error)
- func (o *MLModel) PredictionsFromBatchOptionsError(inputBatch MLBatchProvider, options *MLPredictionOptions) (MLBatchProvider, error)
- type MLModelAsset
- func MLModelAssetFromID(id objc.ID) *MLModelAsset
- func MLModelAssetModelAssetWithSpecificationDataBlobMappingError(specificationData *foundation.NSData, ...) (*MLModelAsset, error)
- func MLModelAssetModelAssetWithSpecificationDataError(specificationData *foundation.NSData) (*MLModelAsset, error)
- func MLModelAssetModelAssetWithURLError(compiledModelURL *foundation.NSURL) (*MLModelAsset, error)
- func (o *MLModelAsset) FunctionNamesWithCompletionHandler(handler objc.Block)
- func (o *MLModelAsset) ModelDescriptionOfFunctionNamedCompletionHandler(functionName *foundation.NSString, ...)
- func (o *MLModelAsset) ModelDescriptionWithCompletionHandler(handler func(*MLModelDescription, unsafe.Pointer))
- type MLModelConfiguration
- func (o *MLModelConfiguration) AllowLowPrecisionAccumulationOnGPU() bool
- func (o *MLModelConfiguration) ComputeUnits() MLComputeUnits
- func (o *MLModelConfiguration) FunctionName() *foundation.NSString
- func (o *MLModelConfiguration) ModelDisplayName() *foundation.NSString
- func (o *MLModelConfiguration) OptimizationHints() *MLOptimizationHints
- func (o *MLModelConfiguration) Parameters() *foundation.NSDictionary[*MLParameterKey, objc.ID]
- func (o *MLModelConfiguration) PreferredMetalDevice() metal.MTLDevice
- func (o *MLModelConfiguration) SetAllowLowPrecisionAccumulationOnGPU(allowLowPrecisionAccumulationOnGPU bool)
- func (o *MLModelConfiguration) SetComputeUnits(computeUnits MLComputeUnits)
- func (o *MLModelConfiguration) SetFunctionName(functionName *foundation.NSString)
- func (o *MLModelConfiguration) SetModelDisplayName(modelDisplayName *foundation.NSString)
- func (o *MLModelConfiguration) SetOptimizationHints(optimizationHints *MLOptimizationHints)
- func (o *MLModelConfiguration) SetParameters(parameters *foundation.NSDictionary[*MLParameterKey, objc.ID])
- func (o *MLModelConfiguration) SetPreferredMetalDevice(preferredMetalDevice metal.MTLDevice)
- type MLModelDescription
- func (o *MLModelDescription) ClassLabels() *foundation.NSArray[objc.ID]
- func (o *MLModelDescription) InputDescriptionsByName() *foundation.NSDictionary[*foundation.NSString, *MLFeatureDescription]
- func (o *MLModelDescription) IsUpdatable() bool
- func (o *MLModelDescription) Metadata() *foundation.NSDictionary[*foundation.NSString, objc.ID]
- func (o *MLModelDescription) OutputDescriptionsByName() *foundation.NSDictionary[*foundation.NSString, *MLFeatureDescription]
- func (o *MLModelDescription) ParameterDescriptionsByKey() *foundation.NSDictionary[*MLParameterKey, *MLParameterDescription]
- func (o *MLModelDescription) PredictedFeatureName() *foundation.NSString
- func (o *MLModelDescription) PredictedProbabilitiesName() *foundation.NSString
- func (o *MLModelDescription) StateDescriptionsByName() *foundation.NSDictionary[*foundation.NSString, *MLFeatureDescription]
- func (o *MLModelDescription) TrainingInputDescriptionsByName() *foundation.NSDictionary[*foundation.NSString, *MLFeatureDescription]
- type MLModelError
- type MLModelStructure
- type MLModelStructureNeuralNetwork
- type MLModelStructureNeuralNetworkLayer
- func (o *MLModelStructureNeuralNetworkLayer) InputNames() *foundation.NSArray[*foundation.NSString]
- func (o *MLModelStructureNeuralNetworkLayer) Name() *foundation.NSString
- func (o *MLModelStructureNeuralNetworkLayer) OutputNames() *foundation.NSArray[*foundation.NSString]
- func (o *MLModelStructureNeuralNetworkLayer) Type() *foundation.NSString
- type MLModelStructurePipeline
- type MLModelStructureProgram
- type MLModelStructureProgramArgument
- type MLModelStructureProgramBinding
- type MLModelStructureProgramBlock
- func (o *MLModelStructureProgramBlock) Inputs() *foundation.NSArray[*MLModelStructureProgramNamedValueType]
- func (o *MLModelStructureProgramBlock) Operations() *foundation.NSArray[*MLModelStructureProgramOperation]
- func (o *MLModelStructureProgramBlock) OutputNames() *foundation.NSArray[*foundation.NSString]
- type MLModelStructureProgramFunction
- type MLModelStructureProgramNamedValueType
- type MLModelStructureProgramOperation
- func (o *MLModelStructureProgramOperation) Blocks() *foundation.NSArray[*MLModelStructureProgramBlock]
- func (o *MLModelStructureProgramOperation) Inputs() ...
- func (o *MLModelStructureProgramOperation) OperatorName() *foundation.NSString
- func (o *MLModelStructureProgramOperation) Outputs() *foundation.NSArray[*MLModelStructureProgramNamedValueType]
- type MLModelStructureProgramValue
- type MLModelStructureProgramValueType
- type MLMultiArray
- func (o *MLMultiArray) Count() int
- func (o *MLMultiArray) DataPointer() unsafe.Pointer
- func (o *MLMultiArray) DataType() MLMultiArrayDataType
- func (o *MLMultiArray) GetBytesWithHandler(handler func(unsafe.Pointer, int))
- func (o *MLMultiArray) GetMutableBytesWithHandler(handler objc.Block)
- func (o *MLMultiArray) InitWithDataPointerShapeDataTypeStridesDeallocatorError(dataPointer unsafe.Pointer, shape *foundation.NSArray[*foundation.NSNumber], ...) (*MLMultiArray, error)
- func (o *MLMultiArray) InitWithPixelBufferShape(pixelBuffer unsafe.Pointer, shape *foundation.NSArray[*foundation.NSNumber]) *MLMultiArray
- func (o *MLMultiArray) InitWithShapeDataTypeError(shape *foundation.NSArray[*foundation.NSNumber], dataType MLMultiArrayDataType) (*MLMultiArray, error)
- func (o *MLMultiArray) InitWithShapeDataTypeStrides(shape *foundation.NSArray[*foundation.NSNumber], dataType MLMultiArrayDataType, ...) *MLMultiArray
- func (o *MLMultiArray) ObjectAtIndexedSubscript(idx int) *foundation.NSNumber
- func (o *MLMultiArray) ObjectForKeyedSubscript(key *foundation.NSArray[*foundation.NSNumber]) *foundation.NSNumber
- func (o *MLMultiArray) PixelBuffer() unsafe.Pointer
- func (o *MLMultiArray) SetObjectAtIndexedSubscript(obj *foundation.NSNumber, idx int)
- func (o *MLMultiArray) SetObjectForKeyedSubscript(obj *foundation.NSNumber, key *foundation.NSArray[*foundation.NSNumber])
- func (o *MLMultiArray) Shape() *foundation.NSArray[*foundation.NSNumber]
- func (o *MLMultiArray) Strides() *foundation.NSArray[*foundation.NSNumber]
- func (o *MLMultiArray) TransferToMultiArray(destinationMultiArray *MLMultiArray)
- type MLMultiArrayConstraint
- type MLMultiArrayDataType
- type MLMultiArrayShapeConstraint
- type MLMultiArrayShapeConstraintType
- type MLNeuralEngineComputeDevice
- type MLNumericConstraint
- type MLOptimizationHints
- func (o *MLOptimizationHints) ReshapeFrequency() MLReshapeFrequencyHint
- func (o *MLOptimizationHints) SetReshapeFrequency(reshapeFrequency MLReshapeFrequencyHint)
- func (o *MLOptimizationHints) SetSpecializationStrategy(specializationStrategy MLSpecializationStrategy)
- func (o *MLOptimizationHints) SpecializationStrategy() MLSpecializationStrategy
- type MLParameterDescription
- type MLParameterKey
- func MLParameterKeyBeta1() *MLParameterKey
- func MLParameterKeyBeta2() *MLParameterKey
- func MLParameterKeyBiases() *MLParameterKey
- func MLParameterKeyEpochs() *MLParameterKey
- func MLParameterKeyEps() *MLParameterKey
- func MLParameterKeyFromID(id objc.ID) *MLParameterKey
- func MLParameterKeyLearningRate() *MLParameterKey
- func MLParameterKeyLinkedModelFileName() *MLParameterKey
- func MLParameterKeyLinkedModelSearchPath() *MLParameterKey
- func MLParameterKeyMiniBatchSize() *MLParameterKey
- func MLParameterKeyMomentum() *MLParameterKey
- func MLParameterKeyNumberOfNeighbors() *MLParameterKey
- func MLParameterKeySeed() *MLParameterKey
- func MLParameterKeyShuffle() *MLParameterKey
- func MLParameterKeyWeights() *MLParameterKey
- type MLPredictionOptions
- func (o *MLPredictionOptions) OutputBackings() *foundation.NSDictionary[*foundation.NSString, objc.ID]
- func (o *MLPredictionOptions) SetOutputBackings(outputBackings *foundation.NSDictionary[*foundation.NSString, objc.ID])
- func (o *MLPredictionOptions) SetUsesCPUOnly(usesCPUOnly bool)deprecated
- func (o *MLPredictionOptions) UsesCPUOnly() bool
- type MLReshapeFrequencyHint
- type MLSequence
- func MLSequenceEmptySequenceWithType(type_ MLFeatureType) *MLSequence
- func MLSequenceFromID(id objc.ID) *MLSequence
- func MLSequenceSequenceWithInt64Array(int64Values *foundation.NSArray[*foundation.NSNumber]) *MLSequence
- func MLSequenceSequenceWithStringArray(stringValues *foundation.NSArray[*foundation.NSString]) *MLSequence
- type MLSequenceConstraint
- type MLSpecializationStrategy
- type MLState
- type MLStateConstraint
- type MLTask
- type MLTaskState
- type MLUpdateContext
- func (o *MLUpdateContext) Event() MLUpdateProgressEvent
- func (o *MLUpdateContext) Metrics() *foundation.NSDictionary[*MLMetricKey, objc.ID]
- func (o *MLUpdateContext) Model() *MLModel
- func (o *MLUpdateContext) Parameters() *foundation.NSDictionary[*MLParameterKey, objc.ID]
- func (o *MLUpdateContext) Task() *MLUpdateTask
- type MLUpdateProgressEvent
- type MLUpdateProgressHandlers
- type MLUpdateTask
- func MLUpdateTaskFromID(id objc.ID) *MLUpdateTask
- func MLUpdateTaskUpdateTaskForModelAtURLTrainingDataCompletionHandlerError(modelURL *foundation.NSURL, trainingData MLBatchProvider, ...) (*MLUpdateTask, error)
- func MLUpdateTaskUpdateTaskForModelAtURLTrainingDataConfigurationCompletionHandlerError(modelURL *foundation.NSURL, trainingData MLBatchProvider, ...) (*MLUpdateTask, error)
- func MLUpdateTaskUpdateTaskForModelAtURLTrainingDataConfigurationProgressHandlersError(modelURL *foundation.NSURL, trainingData MLBatchProvider, ...) (*MLUpdateTask, error)
- func MLUpdateTaskUpdateTaskForModelAtURLTrainingDataProgressHandlersError(modelURL *foundation.NSURL, trainingData MLBatchProvider, ...) (*MLUpdateTask, error)
- type MLWritable
- type MTLCommandBuffer
- type MTLDevice
- type MTLTexture
- type Mach_vm_range_flags_t
- type Mach_vm_range_flavor_t
- type Mach_vm_range_tag_t
- type Mpo_flags_t
- type NXMouseButton
- type Os_clockid_t
- type PMPageToPaperMappingType
- type Ptrauth_key
- type Qos_class_t
- type Virtual_memory_guard_exception_code_t
- type Xpc_listener_create_flags_t
- type Xpc_session_create_flags_t
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MLAllComputeDevices ¶
func MLAllComputeDevices() *foundation.NSArray[MLComputeDeviceProtocol]
@abstract Returns an array containing all compute devices. @discussion The returned array contains all compute devices that are accessible. If a compute device becomes inaccessible for some reason (for e.g. if an external GPU is unplugged) then the subsequent call to`MLAllComputeDevices` will return an array without the compute device.
func MLComputePlanLoadContentsOfURLConfigurationCompletionHandler ¶
func MLComputePlanLoadContentsOfURLConfigurationCompletionHandler(url *foundation.NSURL, configuration *MLModelConfiguration, handler func(*MLComputePlan, unsafe.Pointer))
Construct the compute plan of a model asynchronously given the location of its on-disk representation. @param url The location of its on-disk representation (.mlmodelc directory). @param configuration The model configuration. @param handler When the compute plan is constructed successfully or unsuccessfully, the completion handler is invoked with a valid MLComputePlan instance or NSError object.
func MLComputePlanLoadModelAssetConfigurationCompletionHandler ¶
func MLComputePlanLoadModelAssetConfigurationCompletionHandler(asset *MLModelAsset, configuration *MLModelConfiguration, handler func(*MLComputePlan, unsafe.Pointer))
Construct the compute plan of a model asynchronously given the model asset. @param asset The model asset. @param configuration The model configuration. @param handler When the compute plan is constructed successfully or unsuccessfully, the completion handler is invoked with a valid MLComputePlan instance or NSError object.
func MLFeatureValueImageOptionCropAndScale ¶
func MLFeatureValueImageOptionCropAndScale() *foundation.NSString
Key for VNImageCropAndScaleOption describing how to crop and scale the image (or region of interest) to the desired size
func MLFeatureValueImageOptionCropRect ¶
func MLFeatureValueImageOptionCropRect() *foundation.NSString
Key for CGRect describing a crop region of interest of image source in normalized coordinates
func MLModelAvailableComputeDevices ¶
func MLModelAvailableComputeDevices() *foundation.NSArray[MLComputeDeviceProtocol]
func MLModelCompileModelAtURLCompletionHandler ¶
func MLModelCompileModelAtURLCompletionHandler(modelURL *foundation.NSURL, handler func(*foundation.NSURL, unsafe.Pointer))
func MLModelCompileModelAtURLError ¶
func MLModelCompileModelAtURLError(modelURL *foundation.NSURL) (*foundation.NSURL, error)
Compile a .mlmodel for this device @param modelURL URL file path to .mlmodel file you wish to compile @param error Any errors are surfaced here @returns a URL to the compiled .mlmodelc directory if successful The model is compiled to a temporary location on disk You must move the compiled model to a permanent location if you wish to keep it @discussion The returned model can be loaded using: @code [MLModel modelWithContentsOfURL:error:] @endcode
func MLModelCreatorDefinedKey ¶
func MLModelCreatorDefinedKey() *foundation.NSString
Any additional pertinent information specified by the model creator
func MLModelDescriptionKey ¶
func MLModelDescriptionKey() *foundation.NSString
A short description of what the model does and/or its purpose
func MLModelErrorDomain ¶
func MLModelErrorDomain() uintptr
func MLModelLicenseKey ¶
func MLModelLicenseKey() *foundation.NSString
License information for the model
func MLModelLoadContentsOfURLConfigurationCompletionHandler ¶
func MLModelLoadContentsOfURLConfigurationCompletionHandler(url *foundation.NSURL, configuration *MLModelConfiguration, handler func(*MLModel, unsafe.Pointer))
Construct a model asynchronously given the location of its on-disk representation and configuration. Model loading may take time when the model content is not immediately available (e.g. encrypted model). Use this factory method especially when the caller is on the main thread. @param url the location of its on-disk representation (.mlmodelc directory). @param configuration The model configuration @param handler When the model load completes successfully or unsuccessfully, the completion handler is invoked with a valid MLModel instance or NSError object.
func MLModelLoadModelAssetConfigurationCompletionHandler ¶
func MLModelLoadModelAssetConfigurationCompletionHandler(asset *MLModelAsset, configuration *MLModelConfiguration, handler func(*MLModel, unsafe.Pointer))
Construct a model asynchronously from a compiled model asset. @param asset Compiled model asset derived from in-memory or on-disk Core ML model @param configuration Model configuration that hold options for loading a model @param handler When the model load completes successfully or unsuccessfully, the completion handler is invoked with a valid MLModel instance or NSError object.
func MLModelStructureLoadContentsOfURLCompletionHandler ¶
func MLModelStructureLoadContentsOfURLCompletionHandler(url *foundation.NSURL, handler func(*MLModelStructure, unsafe.Pointer))
Construct the model structure asynchronously given the location of its on-disk representation. @param url The location of its on-disk representation (.mlmodelc directory). @param handler When the model structure is constructed successfully or unsuccessfully, the completion handler is invoked with a valid MLModelStructure instance or NSError object.
func MLModelStructureLoadModelAssetCompletionHandler ¶
func MLModelStructureLoadModelAssetCompletionHandler(asset *MLModelAsset, handler func(*MLModelStructure, unsafe.Pointer))
Construct the model structure asynchronously given the model asset. @param asset The model asset. @param handler When the model structure is constructed successfully or unsuccessfully, the completion handler is invoked with a valid MLModelStructure instance or NSError object.
func MLModelVersionStringKey ¶
func MLModelVersionStringKey() *foundation.NSString
A version number encoded as a string
func SymbolAvailable ¶
SymbolAvailable reports whether the named C symbol was bound when the library loaded. Calling a generated wrapper whose symbol is unavailable dereferences a nil function variable and panics.
Types ¶
type Acl_entry_id_t ¶
type Acl_entry_id_t int64
const ( ACL_FIRST_ENTRY Acl_entry_id_t = 0 ACL_NEXT_ENTRY Acl_entry_id_t = -1 ACL_LAST_ENTRY Acl_entry_id_t = -2 )
func (Acl_entry_id_t) String ¶
func (e Acl_entry_id_t) String() string
type Acl_flag_t ¶
type Acl_flag_t int64
const ( ACL_FLAG_DEFER_INHERIT Acl_flag_t = 1 ACL_FLAG_NO_INHERIT Acl_flag_t = 131072 ACL_ENTRY_INHERITED Acl_flag_t = 16 ACL_ENTRY_FILE_INHERIT Acl_flag_t = 32 ACL_ENTRY_DIRECTORY_INHERIT Acl_flag_t = 64 ACL_ENTRY_LIMIT_INHERIT Acl_flag_t = 128 ACL_ENTRY_ONLY_INHERIT Acl_flag_t = 256 )
func (Acl_flag_t) String ¶
func (e Acl_flag_t) String() string
type Acl_perm_t ¶
type Acl_perm_t int64
const ( ACL_READ_DATA Acl_perm_t = 2 ACL_LIST_DIRECTORY Acl_perm_t = 2 ACL_WRITE_DATA Acl_perm_t = 4 ACL_ADD_FILE Acl_perm_t = 4 ACL_EXECUTE Acl_perm_t = 8 ACL_SEARCH Acl_perm_t = 8 ACL_DELETE Acl_perm_t = 16 ACL_APPEND_DATA Acl_perm_t = 32 ACL_ADD_SUBDIRECTORY Acl_perm_t = 32 ACL_DELETE_CHILD Acl_perm_t = 64 ACL_READ_ATTRIBUTES Acl_perm_t = 128 ACL_WRITE_ATTRIBUTES Acl_perm_t = 256 ACL_READ_EXTATTRIBUTES Acl_perm_t = 512 ACL_WRITE_EXTATTRIBUTES Acl_perm_t = 1024 ACL_READ_SECURITY Acl_perm_t = 2048 ACL_WRITE_SECURITY Acl_perm_t = 4096 ACL_CHANGE_OWNER Acl_perm_t = 8192 ACL_SYNCHRONIZE Acl_perm_t = 1048576 )
func (Acl_perm_t) String ¶
func (e Acl_perm_t) String() string
type Acl_type_t ¶
type Acl_type_t int64
const ( ACL_TYPE_EXTENDED Acl_type_t = 256 ACL_TYPE_ACCESS Acl_type_t = 0 ACL_TYPE_DEFAULT Acl_type_t = 1 ACL_TYPE_AFS Acl_type_t = 2 ACL_TYPE_CODA Acl_type_t = 3 ACL_TYPE_NTFS Acl_type_t = 4 ACL_TYPE_NWFS Acl_type_t = 5 )
func (Acl_type_t) String ¶
func (e Acl_type_t) String() string
type Dispatch_autorelease_frequency_t ¶
type Dispatch_autorelease_frequency_t uint64
const ( DISPATCH_AUTORELEASE_FREQUENCY_INHERIT Dispatch_autorelease_frequency_t = 0 DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM Dispatch_autorelease_frequency_t = 1 DISPATCH_AUTORELEASE_FREQUENCY_NEVER Dispatch_autorelease_frequency_t = 2 )
func (Dispatch_autorelease_frequency_t) String ¶
func (e Dispatch_autorelease_frequency_t) String() string
type Dispatch_block_flags_t ¶
type Dispatch_block_flags_t uint64
const ( DISPATCH_BLOCK_BARRIER Dispatch_block_flags_t = 1 DISPATCH_BLOCK_DETACHED Dispatch_block_flags_t = 2 DISPATCH_BLOCK_ASSIGN_CURRENT Dispatch_block_flags_t = 4 DISPATCH_BLOCK_NO_QOS_CLASS Dispatch_block_flags_t = 8 DISPATCH_BLOCK_INHERIT_QOS_CLASS Dispatch_block_flags_t = 16 DISPATCH_BLOCK_ENFORCE_QOS_CLASS Dispatch_block_flags_t = 32 )
func (Dispatch_block_flags_t) String ¶
func (e Dispatch_block_flags_t) String() string
type Filesec_property_t ¶
type Filesec_property_t int64
const ( FILESEC_OWNER Filesec_property_t = 1 FILESEC_GROUP Filesec_property_t = 2 FILESEC_UUID Filesec_property_t = 3 FILESEC_MODE Filesec_property_t = 4 FILESEC_ACL Filesec_property_t = 5 FILESEC_GRPUUID Filesec_property_t = 6 FILESEC_ACL_RAW Filesec_property_t = 100 FILESEC_ACL_ALLOCSIZE Filesec_property_t = 101 )
func (Filesec_property_t) String ¶
func (e Filesec_property_t) String() string
type Ipc_info_object_type_t ¶
type Ipc_info_object_type_t int64
const ( IPC_OTYPE_NONE Ipc_info_object_type_t = 0 IPC_OTYPE_THREAD_CONTROL Ipc_info_object_type_t = 1 IPC_OTYPE_TASK_CONTROL Ipc_info_object_type_t = 2 IPC_OTYPE_HOST Ipc_info_object_type_t = 3 IPC_OTYPE_HOST_PRIV Ipc_info_object_type_t = 4 IPC_OTYPE_PROCESSOR Ipc_info_object_type_t = 5 IPC_OTYPE_PROCESSOR_SET Ipc_info_object_type_t = 6 IPC_OTYPE_PROCESSOR_SET_NAME Ipc_info_object_type_t = 7 IPC_OTYPE_TIMER Ipc_info_object_type_t = 8 IPC_OTYPE_PORT_SUBST_ONCE Ipc_info_object_type_t = 9 IPC_OTYPE_MIG Ipc_info_object_type_t = 10 IPC_OTYPE_MEMORY_OBJECT Ipc_info_object_type_t = 11 IPC_OTYPE_XMM_PAGER Ipc_info_object_type_t = 12 IPC_OTYPE_XMM_KERNEL Ipc_info_object_type_t = 13 IPC_OTYPE_XMM_REPLY Ipc_info_object_type_t = 14 IPC_OTYPE_UND_REPLY Ipc_info_object_type_t = 15 IPC_OTYPE_HOST_NOTIFY Ipc_info_object_type_t = 16 IPC_OTYPE_HOST_SECURITY Ipc_info_object_type_t = 17 IPC_OTYPE_LEDGER Ipc_info_object_type_t = 18 IPC_OTYPE_MAIN_DEVICE Ipc_info_object_type_t = 19 IPC_OTYPE_TASK_NAME Ipc_info_object_type_t = 20 IPC_OTYPE_SUBSYSTEM Ipc_info_object_type_t = 21 IPC_OTYPE_IO_DONE_QUEUE Ipc_info_object_type_t = 22 IPC_OTYPE_SEMAPHORE Ipc_info_object_type_t = 23 IPC_OTYPE_LOCK_SET Ipc_info_object_type_t = 24 IPC_OTYPE_CLOCK Ipc_info_object_type_t = 25 IPC_OTYPE_CLOCK_CTRL Ipc_info_object_type_t = 26 IPC_OTYPE_IOKIT_IDENT Ipc_info_object_type_t = 27 IPC_OTYPE_NAMED_ENTRY Ipc_info_object_type_t = 28 IPC_OTYPE_IOKIT_CONNECT Ipc_info_object_type_t = 29 IPC_OTYPE_IOKIT_OBJECT Ipc_info_object_type_t = 30 IPC_OTYPE_UPL Ipc_info_object_type_t = 31 IPC_OTYPE_MEM_OBJ_CONTROL Ipc_info_object_type_t = 32 IPC_OTYPE_AU_SESSIONPORT Ipc_info_object_type_t = 33 IPC_OTYPE_FILEPORT Ipc_info_object_type_t = 34 IPC_OTYPE_LABELH Ipc_info_object_type_t = 35 IPC_OTYPE_TASK_RESUME Ipc_info_object_type_t = 36 IPC_OTYPE_VOUCHER Ipc_info_object_type_t = 37 IPC_OTYPE_VOUCHER_ATTR_CONTROL Ipc_info_object_type_t = 38 IPC_OTYPE_WORK_INTERVAL Ipc_info_object_type_t = 39 IPC_OTYPE_UX_HANDLER Ipc_info_object_type_t = 40 IPC_OTYPE_UEXT_OBJECT Ipc_info_object_type_t = 41 IPC_OTYPE_ARCADE_REG Ipc_info_object_type_t = 42 IPC_OTYPE_EVENTLINK Ipc_info_object_type_t = 43 IPC_OTYPE_TASK_INSPECT Ipc_info_object_type_t = 44 IPC_OTYPE_TASK_READ Ipc_info_object_type_t = 45 IPC_OTYPE_THREAD_INSPECT Ipc_info_object_type_t = 46 IPC_OTYPE_THREAD_READ Ipc_info_object_type_t = 47 IPC_OTYPE_SUID_CRED Ipc_info_object_type_t = 48 IPC_OTYPE_HYPERVISOR Ipc_info_object_type_t = 49 IPC_OTYPE_TASK_ID_TOKEN Ipc_info_object_type_t = 50 IPC_OTYPE_TASK_FATAL Ipc_info_object_type_t = 51 IPC_OTYPE_KCDATA Ipc_info_object_type_t = 52 IPC_OTYPE_EXCLAVES_RESOURCE Ipc_info_object_type_t = 53 IPC_OTYPE_THREAD_RESUME Ipc_info_object_type_t = 54 IPC_OTYPE_UNKNOWN Ipc_info_object_type_t = 4294967295 )
func (Ipc_info_object_type_t) String ¶
func (e Ipc_info_object_type_t) String() string
type Launch_data_type_t ¶
type Launch_data_type_t int64
const ( LAUNCH_DATA_DICTIONARY Launch_data_type_t = 1 LAUNCH_DATA_ARRAY Launch_data_type_t = 2 LAUNCH_DATA_FD Launch_data_type_t = 3 LAUNCH_DATA_INTEGER Launch_data_type_t = 4 LAUNCH_DATA_REAL Launch_data_type_t = 5 LAUNCH_DATA_BOOL Launch_data_type_t = 6 LAUNCH_DATA_STRING Launch_data_type_t = 7 LAUNCH_DATA_OPAQUE Launch_data_type_t = 8 LAUNCH_DATA_ERRNO Launch_data_type_t = 9 LAUNCH_DATA_MACHPORT Launch_data_type_t = 10 )
func (Launch_data_type_t) String ¶
func (e Launch_data_type_t) String() string
type MDLabelDomain ¶
type MDLabelDomain int64
@typedef MDLabelDomain @abstract These constants are used to specify a domain to MDLabelCreate().
const ( KMDLabelUserDomain MDLabelDomain = 0 KMDLabelLocalDomain MDLabelDomain = 1 )
func (MDLabelDomain) String ¶
func (e MDLabelDomain) String() string
type MDQueryOptionFlags ¶
type MDQueryOptionFlags int64
const ( KMDQuerySynchronous MDQueryOptionFlags = 1 KMDQueryWantsUpdates MDQueryOptionFlags = 4 KMDQueryAllowFSTranslation MDQueryOptionFlags = 8 )
func (MDQueryOptionFlags) String ¶
func (e MDQueryOptionFlags) String() string
type MDQuerySortOptionFlags ¶
type MDQuerySortOptionFlags int64
@enum MDQuerySortOptionFlags @constant kMDQueryReverseSortOrderFlag Sort the attribute in reverse order.
const (
KMDQueryReverseSortOrderFlag MDQuerySortOptionFlags = 1
)
func (MDQuerySortOptionFlags) String ¶
func (e MDQuerySortOptionFlags) String() string
type MLArrayBatchProvider ¶
type MLArrayBatchProvider struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlarraybatchprovider
func MLArrayBatchProviderFromID ¶
func MLArrayBatchProviderFromID(id objc.ID) *MLArrayBatchProvider
func (*MLArrayBatchProvider) Array ¶
func (o *MLArrayBatchProvider) Array() *foundation.NSArray[MLFeatureProvider]
func (*MLArrayBatchProvider) InitWithDictionaryError ¶
func (o *MLArrayBatchProvider) InitWithDictionaryError(dictionary *foundation.NSDictionary[*foundation.NSString, objc.ID]) (*MLArrayBatchProvider, error)
Initialize with a dictionary which maps feature names to an array of values [String : [Any]] Error is returned if all arrays do not have equal length or if array values for a specific feature name do not have the same type or not expressible as MLFeatureValue
func (*MLArrayBatchProvider) InitWithFeatureProviderArray ¶
func (o *MLArrayBatchProvider) InitWithFeatureProviderArray(array *foundation.NSArray[MLFeatureProvider]) *MLArrayBatchProvider
Initalize with an array of feature providers
type MLBatchProvider ¶
type MLBatchProvider interface {
FeaturesAtIndex(index int) MLFeatureProvider
Count() int
}
MLBatchProvider wraps the ObjC protocol MLBatchProvider.
type MLCPUComputeDevice ¶
type MLCPUComputeDevice struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlcpucomputedevice
func MLCPUComputeDeviceFromID ¶
func MLCPUComputeDeviceFromID(id objc.ID) *MLCPUComputeDevice
type MLComputeDeviceProtocol ¶
type MLComputeDeviceProtocol interface {
}
MLComputeDeviceProtocol wraps the ObjC protocol MLComputeDeviceProtocol.
type MLComputePlan ¶
type MLComputePlan struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlcomputeplan
func MLComputePlanFromID ¶
func MLComputePlanFromID(id objc.ID) *MLComputePlan
func (*MLComputePlan) ComputeDeviceUsageForMLProgramOperation ¶
func (o *MLComputePlan) ComputeDeviceUsageForMLProgramOperation(operation *MLModelStructureProgramOperation) *MLComputePlanDeviceUsage
Returns The anticipated compute devices that would be used for executing an ML Program operation. @param operation An ML Program operation. @returns The anticipated compute devices that would be used for executing the operation or `nil`if the usage couldn't be determined.
func (*MLComputePlan) ComputeDeviceUsageForNeuralNetworkLayer ¶
func (o *MLComputePlan) ComputeDeviceUsageForNeuralNetworkLayer(layer *MLModelStructureNeuralNetworkLayer) *MLComputePlanDeviceUsage
Returns the anticipated compute devices that would be used for executing a NeuralNetwork layer. @param layer A NeuralNetwork layer. @returns The anticipated compute devices that would be used for executing the layer or `nil` if the usage couldn't be determined.
func (*MLComputePlan) EstimatedCostOfMLProgramOperation ¶
func (o *MLComputePlan) EstimatedCostOfMLProgramOperation(operation *MLModelStructureProgramOperation) *MLComputePlanCost
Returns the estimated cost of executing an ML Program operation. @param operation An ML Program operation. @returns The estimated cost of executing the operation or nil if the cost couldn't be estimated.
func (*MLComputePlan) ModelStructure ¶
func (o *MLComputePlan) ModelStructure() *MLModelStructure
type MLComputePlanCost ¶
type MLComputePlanCost struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlcomputeplancost
func MLComputePlanCostFromID ¶
func MLComputePlanCostFromID(id objc.ID) *MLComputePlanCost
func (*MLComputePlanCost) Weight ¶
func (o *MLComputePlanCost) Weight() float64
type MLComputePlanDeviceUsage ¶
type MLComputePlanDeviceUsage struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlcomputeplandeviceusage
func MLComputePlanDeviceUsageFromID ¶
func MLComputePlanDeviceUsageFromID(id objc.ID) *MLComputePlanDeviceUsage
func (*MLComputePlanDeviceUsage) PreferredComputeDevice ¶
func (o *MLComputePlanDeviceUsage) PreferredComputeDevice() MLComputeDeviceProtocol
The compute device that the framework prefers to execute the layer/operation.
func (*MLComputePlanDeviceUsage) SupportedComputeDevices ¶
func (o *MLComputePlanDeviceUsage) SupportedComputeDevices() *foundation.NSArray[MLComputeDeviceProtocol]
The compute devices that can execute the layer/operation.
type MLComputeUnits ¶
type MLComputeUnits int64
const ( MLComputeUnitsCPUOnly MLComputeUnits = 0 MLComputeUnitsCPUAndGPU MLComputeUnits = 1 MLComputeUnitsAll MLComputeUnits = 2 MLComputeUnitsCPUAndNeuralEngine MLComputeUnits = 3 )
func (MLComputeUnits) String ¶
func (e MLComputeUnits) String() string
type MLCustomLayer ¶
type MLCustomLayer interface {
InitWithParameterDictionaryError(parameters *foundation.NSDictionary[*foundation.NSString, objc.ID]) (unsafe.Pointer, error)
SetWeightDataError(weights *foundation.NSArray[*foundation.NSData]) (bool, error)
OutputShapesForInputShapesError(inputShapes *foundation.NSArray[objc.ID]) (*foundation.NSArray[objc.ID], error)
EvaluateOnCPUWithInputsOutputsError(inputs *foundation.NSArray[*MLMultiArray], outputs *foundation.NSArray[*MLMultiArray]) (bool, error)
}
MLCustomLayer wraps the ObjC protocol MLCustomLayer.
type MLCustomModel ¶
type MLCustomModel interface {
InitWithModelDescriptionParameterDictionaryError(modelDescription *MLModelDescription, parameters *foundation.NSDictionary[*foundation.NSString, objc.ID]) (unsafe.Pointer, error)
PredictionFromFeaturesOptionsError(input MLFeatureProvider, options *MLPredictionOptions) (MLFeatureProvider, error)
}
MLCustomModel wraps the ObjC protocol MLCustomModel.
type MLDictionaryConstraint ¶
type MLDictionaryConstraint struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mldictionaryconstraint
func MLDictionaryConstraintFromID ¶
func MLDictionaryConstraintFromID(id objc.ID) *MLDictionaryConstraint
func (*MLDictionaryConstraint) KeyType ¶
func (o *MLDictionaryConstraint) KeyType() MLFeatureType
type MLDictionaryFeatureProvider ¶
type MLDictionaryFeatureProvider struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mldictionaryfeatureprovider
func MLDictionaryFeatureProviderFromID ¶
func MLDictionaryFeatureProviderFromID(id objc.ID) *MLDictionaryFeatureProvider
func (*MLDictionaryFeatureProvider) Dictionary ¶
func (o *MLDictionaryFeatureProvider) Dictionary() *foundation.NSDictionary[*foundation.NSString, *MLFeatureValue]
Dictionary holding the feature values
func (*MLDictionaryFeatureProvider) InitWithDictionaryError ¶
func (o *MLDictionaryFeatureProvider) InitWithDictionaryError(dictionary *foundation.NSDictionary[*foundation.NSString, objc.ID]) (*MLDictionaryFeatureProvider, error)
Create from a generic dictionary by converting all values to MLFeatureValues or from a dictionary with values already stored as MLFeatureValues. An error results if the values are not or cannot be represented as MLFeatureValues.
func (*MLDictionaryFeatureProvider) ObjectForKeyedSubscript ¶
func (o *MLDictionaryFeatureProvider) ObjectForKeyedSubscript(featureName *foundation.NSString) *MLFeatureValue
Get the value for specified feature
type MLFeatureDescription ¶
type MLFeatureDescription struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlfeaturedescription
func MLFeatureDescriptionFromID ¶
func MLFeatureDescriptionFromID(id objc.ID) *MLFeatureDescription
func (*MLFeatureDescription) DictionaryConstraint ¶
func (o *MLFeatureDescription) DictionaryConstraint() *MLDictionaryConstraint
Constraint when type == MLFeatureTypeDictionary, nil otherwise
func (*MLFeatureDescription) ImageConstraint ¶
func (o *MLFeatureDescription) ImageConstraint() *MLImageConstraint
Constraint when type == MLFeatureTypeImage, nil otherwise
func (*MLFeatureDescription) IsAllowedValue ¶
func (o *MLFeatureDescription) IsAllowedValue(value *MLFeatureValue) bool
Check if MLFeatureValue is valid based on this description
func (*MLFeatureDescription) IsOptional ¶
func (o *MLFeatureDescription) IsOptional() bool
Whether this feature can take an undefined value or not
func (*MLFeatureDescription) MultiArrayConstraint ¶
func (o *MLFeatureDescription) MultiArrayConstraint() *MLMultiArrayConstraint
Constraint when type == MLFeatureTypeMultiArray, nil otherwise
func (*MLFeatureDescription) Name ¶
func (o *MLFeatureDescription) Name() *foundation.NSString
Name of feature
func (*MLFeatureDescription) SequenceConstraint ¶
func (o *MLFeatureDescription) SequenceConstraint() *MLSequenceConstraint
Constraint when type == MLFeatureTypeSequence, nil otherwise
func (*MLFeatureDescription) StateConstraint ¶
func (o *MLFeatureDescription) StateConstraint() *MLStateConstraint
The state feature value constraint. The property has a value when `.type == MLFeatureTypeState`.
func (*MLFeatureDescription) Type ¶
func (o *MLFeatureDescription) Type() MLFeatureType
Type of data
type MLFeatureProvider ¶
type MLFeatureProvider interface {
}
MLFeatureProvider wraps the ObjC protocol MLFeatureProvider.
type MLFeatureType ¶
type MLFeatureType int64
const ( MLFeatureTypeInvalid MLFeatureType = 0 // Discrete values, sometimes used to hold numeric encoding of a categorical value MLFeatureTypeInt64 MLFeatureType = 1 // Continuous values MLFeatureTypeDouble MLFeatureType = 2 MLFeatureTypeString MLFeatureType = 3 // CVPixelBufferRef MLFeatureTypeImage MLFeatureType = 4 // MLMultiArray MLFeatureTypeMultiArray MLFeatureType = 5 // Numerically weighted hashable objects (e.g. word counts) MLFeatureTypeDictionary MLFeatureType = 6 // MLSequence. Ordered collection of feature values with the same type MLFeatureTypeSequence MLFeatureType = 7 // MLState. Represents a model state that may be updated in each inference. MLFeatureTypeState MLFeatureType = 8 )
func (MLFeatureType) String ¶
func (e MLFeatureType) String() string
type MLFeatureValue ¶
type MLFeatureValue struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlfeaturevalue
func MLFeatureValueFeatureValueWithCGImageConstraintOptionsError ¶
func MLFeatureValueFeatureValueWithCGImageConstraintOptionsError(cgImage unsafe.Pointer, constraint *MLImageConstraint, options *foundation.NSDictionary[*foundation.NSString, objc.ID]) (*MLFeatureValue, error)
Construct image feature value from CGImage, using the size and type information required by feature description (orientation is assumed to be kCGImagePropertyOrientationUp)
func MLFeatureValueFeatureValueWithCGImageOrientationConstraintOptionsError ¶
func MLFeatureValueFeatureValueWithCGImageOrientationConstraintOptionsError(cgImage unsafe.Pointer, orientation imageio.CGImagePropertyOrientation, constraint *MLImageConstraint, options *foundation.NSDictionary[*foundation.NSString, objc.ID]) (*MLFeatureValue, error)
Construct image feature value from CGImage w/ specified orientation, using the size and type information required by feature description
func MLFeatureValueFeatureValueWithCGImageOrientationPixelsWidePixelsHighPixelFormatTypeOptionsError ¶
func MLFeatureValueFeatureValueWithCGImageOrientationPixelsWidePixelsHighPixelFormatTypeOptionsError(cgImage unsafe.Pointer, orientation imageio.CGImagePropertyOrientation, pixelsWide int, pixelsHigh int, pixelFormatType uint, options *foundation.NSDictionary[*foundation.NSString, objc.ID]) (*MLFeatureValue, error)
Construct image feature value from CGImage w/ specified orientation
func MLFeatureValueFeatureValueWithCGImagePixelsWidePixelsHighPixelFormatTypeOptionsError ¶
func MLFeatureValueFeatureValueWithCGImagePixelsWidePixelsHighPixelFormatTypeOptionsError(cgImage unsafe.Pointer, pixelsWide int, pixelsHigh int, pixelFormatType uint, options *foundation.NSDictionary[*foundation.NSString, objc.ID]) (*MLFeatureValue, error)
Construct image feature value from CGImage (orientation is assumed to be kCGImagePropertyOrientationUp)
func MLFeatureValueFeatureValueWithDictionaryError ¶
func MLFeatureValueFeatureValueWithDictionaryError(value *foundation.NSDictionary[objc.ID, *foundation.NSNumber]) (*MLFeatureValue, error)
For encoding a sparse feature set or for encoding probabilities. Input keys that are not NSNumber * or NSString * are rejected on construction and return a MLModelErrorFeatureTypeMismatch error. Further validation for consistency occurs on evaluation
func MLFeatureValueFeatureValueWithDouble ¶
func MLFeatureValueFeatureValueWithDouble(value float64) *MLFeatureValue
func MLFeatureValueFeatureValueWithImageAtURLConstraintOptionsError ¶
func MLFeatureValueFeatureValueWithImageAtURLConstraintOptionsError(url *foundation.NSURL, constraint *MLImageConstraint, options *foundation.NSDictionary[*foundation.NSString, objc.ID]) (*MLFeatureValue, error)
Construct image feature value from an image on disk, using a model specified image constraint. Orientation is read from Exif if avaiable
func MLFeatureValueFeatureValueWithImageAtURLOrientationConstraintOptionsError ¶
func MLFeatureValueFeatureValueWithImageAtURLOrientationConstraintOptionsError(url *foundation.NSURL, orientation imageio.CGImagePropertyOrientation, constraint *MLImageConstraint, options *foundation.NSDictionary[*foundation.NSString, objc.ID]) (*MLFeatureValue, error)
Construct image feature value from an image on disk using a model specified image constraint. The passed in orientation supersedes any in the file
func MLFeatureValueFeatureValueWithImageAtURLOrientationPixelsWidePixelsHighPixelFormatTypeOptionsError ¶
func MLFeatureValueFeatureValueWithImageAtURLOrientationPixelsWidePixelsHighPixelFormatTypeOptionsError(url *foundation.NSURL, orientation imageio.CGImagePropertyOrientation, pixelsWide int, pixelsHigh int, pixelFormatType uint, options *foundation.NSDictionary[*foundation.NSString, objc.ID]) (*MLFeatureValue, error)
Construct image feature value from an image on disk. The passed in orientation supersedes any in the file
func MLFeatureValueFeatureValueWithImageAtURLPixelsWidePixelsHighPixelFormatTypeOptionsError ¶
func MLFeatureValueFeatureValueWithImageAtURLPixelsWidePixelsHighPixelFormatTypeOptionsError(url *foundation.NSURL, pixelsWide int, pixelsHigh int, pixelFormatType uint, options *foundation.NSDictionary[*foundation.NSString, objc.ID]) (*MLFeatureValue, error)
Construct image feature value from an image on disk. Orientation is read from Exif if avaiable
func MLFeatureValueFeatureValueWithInt64 ¶
func MLFeatureValueFeatureValueWithInt64(value int64) *MLFeatureValue
Hold an object with the specified value
func MLFeatureValueFeatureValueWithMultiArray ¶
func MLFeatureValueFeatureValueWithMultiArray(value *MLMultiArray) *MLFeatureValue
func MLFeatureValueFeatureValueWithPixelBuffer ¶
func MLFeatureValueFeatureValueWithPixelBuffer(value unsafe.Pointer) *MLFeatureValue
func MLFeatureValueFeatureValueWithSequence ¶
func MLFeatureValueFeatureValueWithSequence(sequence *MLSequence) *MLFeatureValue
func MLFeatureValueFeatureValueWithString ¶
func MLFeatureValueFeatureValueWithString(value *foundation.NSString) *MLFeatureValue
func MLFeatureValueFromID ¶
func MLFeatureValueFromID(id objc.ID) *MLFeatureValue
func MLFeatureValueUndefinedFeatureValueWithType ¶
func MLFeatureValueUndefinedFeatureValueWithType(type_ MLFeatureType) *MLFeatureValue
Represent an undefined value of a specified type
func (*MLFeatureValue) DictionaryValue ¶
func (o *MLFeatureValue) DictionaryValue() *foundation.NSDictionary[objc.ID, *foundation.NSNumber]
Populated value if the type is MLFeatureTypeDictionary
func (*MLFeatureValue) DoubleValue ¶
func (o *MLFeatureValue) DoubleValue() float64
Populated value if the type is MLFeatureTypeDouble
func (*MLFeatureValue) ImageBufferValue ¶
func (o *MLFeatureValue) ImageBufferValue() unsafe.Pointer
Populated value if the type is MLFeatureTypeImage
func (*MLFeatureValue) Int64Value ¶
func (o *MLFeatureValue) Int64Value() int64
Populated value if the type is MLFeatureTypeInt64
func (*MLFeatureValue) IsEqualToFeatureValue ¶
func (o *MLFeatureValue) IsEqualToFeatureValue(value *MLFeatureValue) bool
@abstract Returns a Boolean value that indicates whether a feature value is equal to another. @discussion If the types of the MLFeatureValue objects "self" and "value" are integer in one case and double in the other (in either order) then those mixed mode numeric values are compared as NSNumbers. Otherwise if the types of the MLFeatureValue objects are different NO is returned. When "self" and "value" are both PixelBuffer MLFeatureValue types, only their CVPixelBufferRef values are compared for equality, the underlying arrays of pixelValues are not examined. [So, distinct PixelBuffer MLFeatureValue objects with distinct CVPixelBufferRef values which encapsulate the same array of pixels will compare *not* equal.] For all other (matching) MLFeatureValue types, the BOOL value returned is the result of comparing "self" with "value" via isEqualToNumber:, isEqualToString:, isEqualtoDictionary:, isEqualToMultiArray:, isEqualToArray: as chosen by the MLFeatureValue types.
func (*MLFeatureValue) IsUndefined ¶
func (o *MLFeatureValue) IsUndefined() bool
True if the value represents a missing or undefined value
func (*MLFeatureValue) MultiArrayValue ¶
func (o *MLFeatureValue) MultiArrayValue() *MLMultiArray
Populated value if the type is MLFeatureTypeMultiArray
func (*MLFeatureValue) SequenceValue ¶
func (o *MLFeatureValue) SequenceValue() *MLSequence
Populated value if the type is MLFeatureTypeSequence
func (*MLFeatureValue) StringValue ¶
func (o *MLFeatureValue) StringValue() *foundation.NSString
Populated value if the type is MLFeatureTypeString
func (*MLFeatureValue) Type ¶
func (o *MLFeatureValue) Type() MLFeatureType
Type of the value for which the corresponding property below is held
type MLGPUComputeDevice ¶
type MLGPUComputeDevice struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlgpucomputedevice
func MLGPUComputeDeviceFromID ¶
func MLGPUComputeDeviceFromID(id objc.ID) *MLGPUComputeDevice
func (*MLGPUComputeDevice) MetalDevice ¶
func (o *MLGPUComputeDevice) MetalDevice() metal.MTLDevice
type MLImageConstraint ¶
type MLImageConstraint struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlimageconstraint
func MLImageConstraintFromID ¶
func MLImageConstraintFromID(id objc.ID) *MLImageConstraint
func (*MLImageConstraint) PixelFormatType ¶
func (o *MLImageConstraint) PixelFormatType() uint
The accepted kCVPixelFormatType for the image.
func (*MLImageConstraint) PixelsHigh ¶
func (o *MLImageConstraint) PixelsHigh() int
The required or default height of the image
func (*MLImageConstraint) PixelsWide ¶
func (o *MLImageConstraint) PixelsWide() int
The required or default width of the image
func (*MLImageConstraint) SizeConstraint ¶
func (o *MLImageConstraint) SizeConstraint() *MLImageSizeConstraint
Detailed image size constraint
type MLImageSize ¶
type MLImageSize struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlimagesize
func MLImageSizeFromID ¶
func MLImageSizeFromID(id objc.ID) *MLImageSize
func (*MLImageSize) PixelsHigh ¶
func (o *MLImageSize) PixelsHigh() int
func (*MLImageSize) PixelsWide ¶
func (o *MLImageSize) PixelsWide() int
type MLImageSizeConstraint ¶
type MLImageSizeConstraint struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlimagesizeconstraint
func MLImageSizeConstraintFromID ¶
func MLImageSizeConstraintFromID(id objc.ID) *MLImageSizeConstraint
func (*MLImageSizeConstraint) EnumeratedImageSizes ¶
func (o *MLImageSizeConstraint) EnumeratedImageSizes() *foundation.NSArray[*MLImageSize]
func (*MLImageSizeConstraint) PixelsHighRange ¶
func (o *MLImageSizeConstraint) PixelsHighRange() foundation.NSRange
func (*MLImageSizeConstraint) PixelsWideRange ¶
func (o *MLImageSizeConstraint) PixelsWideRange() foundation.NSRange
func (*MLImageSizeConstraint) Type ¶
func (o *MLImageSizeConstraint) Type() MLImageSizeConstraintType
type MLImageSizeConstraintType ¶
type MLImageSizeConstraintType int64
const ( MLImageSizeConstraintTypeUnspecified MLImageSizeConstraintType = 0 MLImageSizeConstraintTypeEnumerated MLImageSizeConstraintType = 2 MLImageSizeConstraintTypeRange MLImageSizeConstraintType = 3 )
func (MLImageSizeConstraintType) String ¶
func (e MLImageSizeConstraintType) String() string
type MLKey ¶
type MLKey struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlkey
func MLKeyFromID ¶
func (*MLKey) Name ¶
func (o *MLKey) Name() *foundation.NSString
func (*MLKey) Scope ¶
func (o *MLKey) Scope() *foundation.NSString
type MLMetricKey ¶
type MLMetricKey struct {
MLKey
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmetrickey
func MLMetricKeyEpochIndex ¶
func MLMetricKeyEpochIndex() *MLMetricKey
func MLMetricKeyFromID ¶
func MLMetricKeyFromID(id objc.ID) *MLMetricKey
func MLMetricKeyLossValue ¶
func MLMetricKeyLossValue() *MLMetricKey
func MLMetricKeyMiniBatchIndex ¶
func MLMetricKeyMiniBatchIndex() *MLMetricKey
type MLModel ¶
type MLModel struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodel
func MLModelFromID ¶
func MLModelModelWithContentsOfURLConfigurationError ¶
func MLModelModelWithContentsOfURLConfigurationError(url *foundation.NSURL, configuration *MLModelConfiguration) (*MLModel, error)
Construct a model given the location of its on-disk representation. Returns nil on error.
func MLModelModelWithContentsOfURLError ¶
func MLModelModelWithContentsOfURLError(url *foundation.NSURL) (*MLModel, error)
Construct a model with a default MLModelConfiguration object
func (*MLModel) Configuration ¶
func (o *MLModel) Configuration() *MLModelConfiguration
The load-time parameters used to instantiate this MLModel object.
func (*MLModel) ModelDescription ¶
func (o *MLModel) ModelDescription() *MLModelDescription
A model holds a description of its required inputs and expected outputs.
func (*MLModel) NewState ¶
Creates a new state object. Core ML framework will allocate the state buffers declared in the model. The allocated state buffers are initialized to zeros. To initialize with different values, use `.withMultiArray(for:)` to get the mutable `MLMultiArray`-view to the state buffer. It returns an empty state when the model is stateless. One can use the empty state with stateful prediction functions such as `prediction(from:using:)` and those predictions will be stateless. This simplifies the call site which may or may not use a stateful model. ```swift // Create state that contains two state buffers: s1 and s2. // Then, initialize s1 to 1.0 and s2 to 2.0. let state = model.newState() state.withMultiArray(for: "s1") { stateMultiArray in stateMultiArray[0] = 1.0 } state.withMultiArray(for: "s2") { stateMultiArray in stateMultiArray[0] = 2.0 } ```
func (*MLModel) ParameterValueForKeyError ¶
func (o *MLModel) ParameterValueForKeyError(key *MLParameterKey) (objc.ID, error)
Provides value for the given parameter. Returns nil on error.
func (*MLModel) PredictionFromFeaturesCompletionHandler ¶
func (o *MLModel) PredictionFromFeaturesCompletionHandler(input MLFeatureProvider, completionHandler func(objc.ID, unsafe.Pointer))
Run a prediction on a model asynchronously. This is a convenience overload method of `prediction(from:options:) async` that uses the default prediction options. - Parameters - input: The input features to make a prediction from. - completionHandler: A block that will be invoked once the prediction has completed successfully or unsuccessfully. On success, it is invoked with a valid model output. On failure, it is invoked with a nil output and NSError
func (*MLModel) PredictionFromFeaturesError ¶
func (o *MLModel) PredictionFromFeaturesError(input MLFeatureProvider) (MLFeatureProvider, error)
Run a prediction on a model synchronously. This is a convenience overload method of `prediction(from:options:)` that uses the default prediction options. - Parameters - input: The input features to make a prediction from. - error: The output parameter to be filled with error information on failure. - Returns: The output features from the prediction.
func (*MLModel) PredictionFromFeaturesOptionsCompletionHandler ¶
func (o *MLModel) PredictionFromFeaturesOptionsCompletionHandler(input MLFeatureProvider, options *MLPredictionOptions, completionHandler func(objc.ID, unsafe.Pointer))
Run a prediction on a model asynchronously. - Parameters - input: The input features to make a prediction from. - options: Prediction options to modify how the prediction is run. - completionHandler: A block that will be invoked once the prediction has completed successfully or unsuccessfully. On success, it is invoked with a valid model output. On failure, it is invoked with a nil output and NSError
func (*MLModel) PredictionFromFeaturesOptionsError ¶
func (o *MLModel) PredictionFromFeaturesOptionsError(input MLFeatureProvider, options *MLPredictionOptions) (MLFeatureProvider, error)
Run a prediction on a model synchronously - Parameters - input: The input features to make a prediction from. - options: Prediction options to modify how the prediction is run. - error: The output parameter to be filled with error information on failure. - Returns: The output features from the prediction.
func (*MLModel) PredictionFromFeaturesUsingStateError ¶
func (o *MLModel) PredictionFromFeaturesUsingStateError(inputFeatures MLFeatureProvider, state *MLState) (MLFeatureProvider, error)
Run a stateful prediction synchronously. Use this method to run predictions on a stateful model. ```swift let state = model.newState() let prediction = try model.prediction(from: inputFeatures, using: state) ``` - Parameters: - inputFeatures: The input features as declared in the model description. - state: The state object created by `newState()` method. - error: The output parameter to receive an error information on failure.
func (*MLModel) PredictionFromFeaturesUsingStateOptionsCompletionHandler ¶
func (o *MLModel) PredictionFromFeaturesUsingStateOptionsCompletionHandler(inputFeatures MLFeatureProvider, state *MLState, options *MLPredictionOptions, completionHandler func(objc.ID, unsafe.Pointer))
Run a stateful prediction asynchronously. Use this method to run predictions on a stateful model. Do not request a prediction while another prediction that shares the same state is in-flight, otherwise the behavior is undefined. ```swift let state = model.newState() let prediction = try await model.prediction(from: inputFeatures, using: state) ``` - Parameters - input: The input features to make a prediction from. - state: The state object created by `newState()` method. - options: Prediction options to modify how the prediction is run. - completionHandler: A block that will be invoked once the prediction has completed successfully or unsuccessfully. On success, it is invoked with a valid model output. On failure, it is invoked with a nil output and NSError
func (*MLModel) PredictionFromFeaturesUsingStateOptionsError ¶
func (o *MLModel) PredictionFromFeaturesUsingStateOptionsError(inputFeatures MLFeatureProvider, state *MLState, options *MLPredictionOptions) (MLFeatureProvider, error)
Run a stateful prediction synchronously with options. Use this method to run predictions on a stateful model. ```swift let state = model.newState() let prediction = try model.prediction(from: inputFeatures, using: state, options: predictionOptions) ``` - Parameters: - inputFeatures: The input features as declared in the model description. - state: The state object created by `newState()` method. - options: The prediction options. - error: The output parameter to receive an error information on failure.
func (*MLModel) PredictionsFromBatchError ¶
func (o *MLModel) PredictionsFromBatchError(inputBatch MLBatchProvider) (MLBatchProvider, error)
Batch prediction without explicit options
func (*MLModel) PredictionsFromBatchOptionsError ¶
func (o *MLModel) PredictionsFromBatchOptionsError(inputBatch MLBatchProvider, options *MLPredictionOptions) (MLBatchProvider, error)
Batch prediction with explicit options
type MLModelAsset ¶
type MLModelAsset struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodelasset
func MLModelAssetFromID ¶
func MLModelAssetFromID(id objc.ID) *MLModelAsset
func MLModelAssetModelAssetWithSpecificationDataBlobMappingError ¶
func MLModelAssetModelAssetWithSpecificationDataBlobMappingError(specificationData *foundation.NSData, blobMapping *foundation.NSDictionary[*foundation.NSURL, *foundation.NSData]) (*MLModelAsset, error)
Construct a model asset from an ML Program specification by replacing blob file references with corresponding in-memory blobs. An ML Program may use `BlobFileValue` syntax, which stores the blob data in external files and refers them by URL. This factory method enables in-memory workflow for such models by using the specified in-memory blob data in place of the external files. The format of in-memory blobs must be the same as the external files. The dictionary must contain all the reference URLs used in the specification. - Parameters: - specification: Contents of .mlmodel as a data blob. - blobMapping: A dictionary with blob URL as the key and blob data as the value. - error: When the model asset creation fails error is populated with the reason for failure.
func MLModelAssetModelAssetWithSpecificationDataError ¶
func MLModelAssetModelAssetWithSpecificationDataError(specificationData *foundation.NSData) (*MLModelAsset, error)
Construct a model asset from the contents of specification data. - Parameters: - specificationData: Contents of .mlmodel as a data blob. - error: When the model asset creation fails error is populated with the reason for failure.
func MLModelAssetModelAssetWithURLError ¶
func MLModelAssetModelAssetWithURLError(compiledModelURL *foundation.NSURL) (*MLModelAsset, error)
Constructs a ModelAsset from a compiled model URL. - Parameters: - compiledModelURL: Location on the disk where the model asset is present. - error: Errors if the model asset is not loadable. - Returns: a model asset or nil if there is an error.
func (*MLModelAsset) FunctionNamesWithCompletionHandler ¶
func (o *MLModelAsset) FunctionNamesWithCompletionHandler(handler objc.Block)
The list of function names in the model asset. Some model types (e.g. ML Program) supports multiple functions. Use this method to query the function names. The method vends the empty array when the model doesn't use the multi-function configuration. ```swift let modelAsset = try MLModelAsset(url: modelURL) let functionNames = try await modelAsset.functionNames print(functionNames) // For example, ["my_function1", "my_function2"]; ```
func (*MLModelAsset) ModelDescriptionOfFunctionNamedCompletionHandler ¶
func (o *MLModelAsset) ModelDescriptionOfFunctionNamedCompletionHandler(functionName *foundation.NSString, handler func(*MLModelDescription, unsafe.Pointer))
The model descripton for a specified function. Use this method to get the description of the model such as the feature descriptions, the model author, and other metadata. ```swift let modelAsset = try MLModelAsset(url: modelURL) let modelDescription = try await modelAsset.modelDescription(of: "my_function") print(modelDescription) ```
func (*MLModelAsset) ModelDescriptionWithCompletionHandler ¶
func (o *MLModelAsset) ModelDescriptionWithCompletionHandler(handler func(*MLModelDescription, unsafe.Pointer))
The default model descripton. Use this method to get the description of the model such as the feature descriptions, the model author, and other metadata. For the multi-function model asset, this method vends the description for the default function. Use `modelDescription(for:)` to get the model description of other functions. ```swift let modelAsset = try MLModelAsset(url: modelURL) let modelDescription = try await modelAsset.modelDescription() print(modelDescription) ```
type MLModelConfiguration ¶
type MLModelConfiguration struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodelconfiguration
func MLModelConfigurationFromID ¶
func MLModelConfigurationFromID(id objc.ID) *MLModelConfiguration
func (*MLModelConfiguration) AllowLowPrecisionAccumulationOnGPU ¶
func (o *MLModelConfiguration) AllowLowPrecisionAccumulationOnGPU() bool
Set to YES to allow low precision accumulation on GPU when available. Defaults to NO
func (*MLModelConfiguration) ComputeUnits ¶
func (o *MLModelConfiguration) ComputeUnits() MLComputeUnits
func (*MLModelConfiguration) FunctionName ¶
func (o *MLModelConfiguration) FunctionName() *foundation.NSString
func (*MLModelConfiguration) ModelDisplayName ¶
func (o *MLModelConfiguration) ModelDisplayName() *foundation.NSString
A human readable name of a MLModel instance for display purposes. Use this property to set a name of a model instance so that runtime analysis tools (e.g. Instruments and os_log) can display that name in the user interface. CoreML framework doesn't parse nor filter the text. It is the client's responsibility to use appropriate text, which may involve localization and privacy considerations. When the property is nil, CoreML framework provides a default.
func (*MLModelConfiguration) OptimizationHints ¶
func (o *MLModelConfiguration) OptimizationHints() *MLOptimizationHints
A group of hints for CoreML to optimize
func (*MLModelConfiguration) Parameters ¶
func (o *MLModelConfiguration) Parameters() *foundation.NSDictionary[*MLParameterKey, objc.ID]
func (*MLModelConfiguration) PreferredMetalDevice ¶
func (o *MLModelConfiguration) PreferredMetalDevice() metal.MTLDevice
Set to specify a preferred Metal device. Defaults to nil which indicates automatic selection
func (*MLModelConfiguration) SetAllowLowPrecisionAccumulationOnGPU ¶
func (o *MLModelConfiguration) SetAllowLowPrecisionAccumulationOnGPU(allowLowPrecisionAccumulationOnGPU bool)
func (*MLModelConfiguration) SetComputeUnits ¶
func (o *MLModelConfiguration) SetComputeUnits(computeUnits MLComputeUnits)
func (*MLModelConfiguration) SetFunctionName ¶
func (o *MLModelConfiguration) SetFunctionName(functionName *foundation.NSString)
func (*MLModelConfiguration) SetModelDisplayName ¶
func (o *MLModelConfiguration) SetModelDisplayName(modelDisplayName *foundation.NSString)
func (*MLModelConfiguration) SetOptimizationHints ¶
func (o *MLModelConfiguration) SetOptimizationHints(optimizationHints *MLOptimizationHints)
func (*MLModelConfiguration) SetParameters ¶
func (o *MLModelConfiguration) SetParameters(parameters *foundation.NSDictionary[*MLParameterKey, objc.ID])
func (*MLModelConfiguration) SetPreferredMetalDevice ¶
func (o *MLModelConfiguration) SetPreferredMetalDevice(preferredMetalDevice metal.MTLDevice)
type MLModelDescription ¶
type MLModelDescription struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodeldescription
func MLModelDescriptionFromID ¶
func MLModelDescriptionFromID(id objc.ID) *MLModelDescription
func (*MLModelDescription) ClassLabels ¶
func (o *MLModelDescription) ClassLabels() *foundation.NSArray[objc.ID]
Array to map a class index to the corresponding label, which is either Number or String. The property is populated from the classLabels entry specified in the model's protobuf message. When the model is a pipeline, which contains one or more sub models, the property value is calculated as follows. 1. If the pipeline model's proto message specifies predictedFeatureName parameter, use classLabels property value of the sub model with the output feature with the name. 2. Otherwise, if the pipeline model has only one sub model with non-nil classLabels property, use the property value. 3. Otherwise, the property is nil.
func (*MLModelDescription) InputDescriptionsByName ¶
func (o *MLModelDescription) InputDescriptionsByName() *foundation.NSDictionary[*foundation.NSString, *MLFeatureDescription]
Description of the inputs to the model
func (*MLModelDescription) IsUpdatable ¶
func (o *MLModelDescription) IsUpdatable() bool
func (*MLModelDescription) Metadata ¶
func (o *MLModelDescription) Metadata() *foundation.NSDictionary[*foundation.NSString, objc.ID]
Optional metadata describing the model
func (*MLModelDescription) OutputDescriptionsByName ¶
func (o *MLModelDescription) OutputDescriptionsByName() *foundation.NSDictionary[*foundation.NSString, *MLFeatureDescription]
Description of the outputs from the model
func (*MLModelDescription) ParameterDescriptionsByKey ¶
func (o *MLModelDescription) ParameterDescriptionsByKey() *foundation.NSDictionary[*MLParameterKey, *MLParameterDescription]
func (*MLModelDescription) PredictedFeatureName ¶
func (o *MLModelDescription) PredictedFeatureName() *foundation.NSString
Name of the primary target / predicted output feature in the output descriptions
func (*MLModelDescription) PredictedProbabilitiesName ¶
func (o *MLModelDescription) PredictedProbabilitiesName() *foundation.NSString
Key for all predicted probabilities stored as a MLFeatureTypeDictionary in the output descriptions
func (*MLModelDescription) StateDescriptionsByName ¶
func (o *MLModelDescription) StateDescriptionsByName() *foundation.NSDictionary[*foundation.NSString, *MLFeatureDescription]
Description of the state features.
func (*MLModelDescription) TrainingInputDescriptionsByName ¶
func (o *MLModelDescription) TrainingInputDescriptionsByName() *foundation.NSDictionary[*foundation.NSString, *MLFeatureDescription]
type MLModelError ¶
type MLModelError int64
const ( // Core ML throws/returns this error when the framework encounters an generic error. The typical cause for this error is an unexpected framework level problem. MLModelErrorGeneric MLModelError = 0 // Core ML throws/returns this error when the model client, typically an application, sends the wrong feature type to a model's input. The typical cause for this error is a programming mistake. For example, a prediction method will throw/return the error when the caller passes an image to a model's input that expects an `MLMultiArray`. MLModelErrorFeatureType MLModelError = 1 // Core ML throws/returns this error when the framework encounters some I/O problem, most likely a file I/O problem. For example, a model loading will throw/return the error when the caller requests a non-existing model URL. MLModelErrorIO MLModelError = 3 // Core ML throws/returns this error when the framework encounters an error in the custom layer subsystem. The typical cause for this error is a programming mistake. For example, a prediction method will throw/return the error when it fails to find the custom layer implementation. MLModelErrorCustomLayer MLModelError = 4 // Core ML throws/returns this error when the framework encounters an error in the custom model subsystem. The typical cause for this error is a programming mistake. For example, a prediction method will throw/return the error when it fails to find the custom model implementation. MLModelErrorCustomModel MLModelError = 5 // Core ML throws/returns this error when the framework encounters an error while performing the on-device model update. For example, the framework will throw/return the error when it fails to save the updated model. MLModelErrorUpdate MLModelError = 6 // Core ML throws/returns this error when the model client, typically an application, queries an unsupported model parameter (see MLParameterKey). The typical cause for this error is a programming mistake. MLModelErrorParameters MLModelError = 7 // Core ML throws/returns this error when the framework fails to download the model decryption key. The typical cause for this error is a network connection issue to the key server. MLModelErrorModelDecryptionKeyFetch MLModelError = 8 // Core ML throws/returns this error when the framework encounters an error in the model decryption subsystem. The typical cause for this error is in the key server configuration and the client application cannot do much about it. For example, a model loading method will throw/return the error when it uses incorrect model decryption key. MLModelErrorModelDecryption MLModelError = 9 // Core ML throws/returns this error when the framework encounters an error in the model collection deployment subsystem. The typical cause for this error is the network connectability issue to the model deployment server. MLModelErrorModelCollection MLModelError = 10 // Core ML throws/returns this error when the prediction is cancelled prior to completing. MLModelErrorPredictionCancelled MLModelError = 11 )
func (MLModelError) String ¶
func (e MLModelError) String() string
type MLModelStructure ¶
type MLModelStructure struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodelstructure
func MLModelStructureFromID ¶
func MLModelStructureFromID(id objc.ID) *MLModelStructure
func (*MLModelStructure) NeuralNetwork ¶
func (o *MLModelStructure) NeuralNetwork() *MLModelStructureNeuralNetwork
If the model is of NeuralNetwork type then it is the structure of the NeuralNetwork otherwise `nil`.
func (*MLModelStructure) Pipeline ¶
func (o *MLModelStructure) Pipeline() *MLModelStructurePipeline
If the model is of Pipeline type then it is the structure of the Pipeline otherwise `nil`.
func (*MLModelStructure) Program ¶
func (o *MLModelStructure) Program() *MLModelStructureProgram
If the model is of ML Program type then it is the structure of the ML Program otherwise `nil`.
type MLModelStructureNeuralNetwork ¶
type MLModelStructureNeuralNetwork struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodelstructureneuralnetwork
func MLModelStructureNeuralNetworkFromID ¶
func MLModelStructureNeuralNetworkFromID(id objc.ID) *MLModelStructureNeuralNetwork
func (*MLModelStructureNeuralNetwork) Layers ¶
func (o *MLModelStructureNeuralNetwork) Layers() *foundation.NSArray[*MLModelStructureNeuralNetworkLayer]
type MLModelStructureNeuralNetworkLayer ¶
type MLModelStructureNeuralNetworkLayer struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodelstructureneuralnetworklayer
func MLModelStructureNeuralNetworkLayerFromID ¶
func MLModelStructureNeuralNetworkLayerFromID(id objc.ID) *MLModelStructureNeuralNetworkLayer
func (*MLModelStructureNeuralNetworkLayer) InputNames ¶
func (o *MLModelStructureNeuralNetworkLayer) InputNames() *foundation.NSArray[*foundation.NSString]
The input names.
func (*MLModelStructureNeuralNetworkLayer) Name ¶
func (o *MLModelStructureNeuralNetworkLayer) Name() *foundation.NSString
The layer name.
func (*MLModelStructureNeuralNetworkLayer) OutputNames ¶
func (o *MLModelStructureNeuralNetworkLayer) OutputNames() *foundation.NSArray[*foundation.NSString]
The output names.
func (*MLModelStructureNeuralNetworkLayer) Type ¶
func (o *MLModelStructureNeuralNetworkLayer) Type() *foundation.NSString
The type of the layer, e,g, "elementwise", "pooling", etc.
type MLModelStructurePipeline ¶
type MLModelStructurePipeline struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodelstructurepipeline
func MLModelStructurePipelineFromID ¶
func MLModelStructurePipelineFromID(id objc.ID) *MLModelStructurePipeline
func (*MLModelStructurePipeline) SubModelNames ¶
func (o *MLModelStructurePipeline) SubModelNames() *foundation.NSArray[*foundation.NSString]
The names of the sub models in the pipeline.
func (*MLModelStructurePipeline) SubModels ¶
func (o *MLModelStructurePipeline) SubModels() *foundation.NSArray[*MLModelStructure]
The structure of the sub models in the pipeline.
type MLModelStructureProgram ¶
type MLModelStructureProgram struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodelstructureprogram
func MLModelStructureProgramFromID ¶
func MLModelStructureProgramFromID(id objc.ID) *MLModelStructureProgram
func (*MLModelStructureProgram) Functions ¶
func (o *MLModelStructureProgram) Functions() *foundation.NSDictionary[*foundation.NSString, *MLModelStructureProgramFunction]
type MLModelStructureProgramArgument ¶
type MLModelStructureProgramArgument struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodelstructureprogramargument
func MLModelStructureProgramArgumentFromID ¶
func MLModelStructureProgramArgumentFromID(id objc.ID) *MLModelStructureProgramArgument
func (*MLModelStructureProgramArgument) Bindings ¶
func (o *MLModelStructureProgramArgument) Bindings() *foundation.NSArray[*MLModelStructureProgramBinding]
type MLModelStructureProgramBinding ¶
type MLModelStructureProgramBinding struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodelstructureprogrambinding
func MLModelStructureProgramBindingFromID ¶
func MLModelStructureProgramBindingFromID(id objc.ID) *MLModelStructureProgramBinding
func (*MLModelStructureProgramBinding) Name ¶
func (o *MLModelStructureProgramBinding) Name() *foundation.NSString
The name of the variable in the Program.
func (*MLModelStructureProgramBinding) Value ¶
func (o *MLModelStructureProgramBinding) Value() *MLModelStructureProgramValue
The compile time constant value in the Program.
type MLModelStructureProgramBlock ¶
type MLModelStructureProgramBlock struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodelstructureprogramblock
func MLModelStructureProgramBlockFromID ¶
func MLModelStructureProgramBlockFromID(id objc.ID) *MLModelStructureProgramBlock
func (*MLModelStructureProgramBlock) Inputs ¶
func (o *MLModelStructureProgramBlock) Inputs() *foundation.NSArray[*MLModelStructureProgramNamedValueType]
The named inputs to the block.
func (*MLModelStructureProgramBlock) Operations ¶
func (o *MLModelStructureProgramBlock) Operations() *foundation.NSArray[*MLModelStructureProgramOperation]
The list of topologically sorted operations in the block.
func (*MLModelStructureProgramBlock) OutputNames ¶
func (o *MLModelStructureProgramBlock) OutputNames() *foundation.NSArray[*foundation.NSString]
The output names.
type MLModelStructureProgramFunction ¶
type MLModelStructureProgramFunction struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodelstructureprogramfunction
func MLModelStructureProgramFunctionFromID ¶
func MLModelStructureProgramFunctionFromID(id objc.ID) *MLModelStructureProgramFunction
func (*MLModelStructureProgramFunction) Block ¶
func (o *MLModelStructureProgramFunction) Block() *MLModelStructureProgramBlock
The active block in the function.
func (*MLModelStructureProgramFunction) Inputs ¶
func (o *MLModelStructureProgramFunction) Inputs() *foundation.NSArray[*MLModelStructureProgramNamedValueType]
The named inputs to the function.
type MLModelStructureProgramNamedValueType ¶
type MLModelStructureProgramNamedValueType struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodelstructureprogramnamedvaluetype
func MLModelStructureProgramNamedValueTypeFromID ¶
func MLModelStructureProgramNamedValueTypeFromID(id objc.ID) *MLModelStructureProgramNamedValueType
func (*MLModelStructureProgramNamedValueType) Name ¶
func (o *MLModelStructureProgramNamedValueType) Name() *foundation.NSString
The name of the parameter.
func (*MLModelStructureProgramNamedValueType) Type ¶
func (o *MLModelStructureProgramNamedValueType) Type() *MLModelStructureProgramValueType
The type of the parameter.
type MLModelStructureProgramOperation ¶
type MLModelStructureProgramOperation struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodelstructureprogramoperation
func MLModelStructureProgramOperationFromID ¶
func MLModelStructureProgramOperationFromID(id objc.ID) *MLModelStructureProgramOperation
func (*MLModelStructureProgramOperation) Blocks ¶
func (o *MLModelStructureProgramOperation) Blocks() *foundation.NSArray[*MLModelStructureProgramBlock]
Nested blocks for loops and conditionals, e.g., a conditional block will have two entries here.
func (*MLModelStructureProgramOperation) Inputs ¶
func (o *MLModelStructureProgramOperation) Inputs() *foundation.NSDictionary[*foundation.NSString, *MLModelStructureProgramArgument]
The arguments to the Operation.
func (*MLModelStructureProgramOperation) OperatorName ¶
func (o *MLModelStructureProgramOperation) OperatorName() *foundation.NSString
The name of the operator, e.g., "conv", "pool", "softmax", etc.
func (*MLModelStructureProgramOperation) Outputs ¶
func (o *MLModelStructureProgramOperation) Outputs() *foundation.NSArray[*MLModelStructureProgramNamedValueType]
The outputs of the Operation.
type MLModelStructureProgramValue ¶
type MLModelStructureProgramValue struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodelstructureprogramvalue
func MLModelStructureProgramValueFromID ¶
func MLModelStructureProgramValueFromID(id objc.ID) *MLModelStructureProgramValue
type MLModelStructureProgramValueType ¶
type MLModelStructureProgramValueType struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmodelstructureprogramvaluetype
func MLModelStructureProgramValueTypeFromID ¶
func MLModelStructureProgramValueTypeFromID(id objc.ID) *MLModelStructureProgramValueType
type MLMultiArray ¶
type MLMultiArray struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmultiarray
func MLMultiArrayFromID ¶
func MLMultiArrayFromID(id objc.ID) *MLMultiArray
func MLMultiArrayMultiArrayByConcatenatingMultiArraysAlongAxisDataType ¶
func MLMultiArrayMultiArrayByConcatenatingMultiArraysAlongAxisDataType(multiArrays *foundation.NSArray[*MLMultiArray], axis int, dataType MLMultiArrayDataType) *MLMultiArray
Concatenate MLMultiArrays to form a new MLMultiArray. All the source MLMultiArrays must have a same shape except the specified axis. The resultant MLMultiArray has the same shape as inputs except this axis, which dimension will be the sum of all the input dimensions of the axis. For example, ```swift // Swift let A = try MLMultiArray(shape: [2, 3], dataType: .int32) let B = try MLMultiArray(shape: [2, 2], dataType: .int32) let C = MLMultiArray(concatenating: [A, B], axis: 1, dataType: .int32) assert(C.shape == [2, 5]) ``` ```objc // Obj-C MLMultiArray *A = [[MLMultiArray alloc] initWithShape:@[@2, @3] dataType:MLMultiArrayDataTypeInt32 error:NULL]; MLMultiArray *B = [[MLMultiArray alloc] initWithShape:@[@2, @2] dataType:MLMultiArrayDataTypeInt32 error:NULL]; MLMultiArray *C = [MLMultiArray multiArrayByConcatenatingMultiArrays:@[A, B] alongAxis:1 dataType:MLMultiArrayDataTypeInt32]; assert(C.shape == @[@2, @5]) ``` Numeric data will be up or down casted as needed. The method raises NSInvalidArgumentException if the shapes of input multi arrays are not compatible for concatenation. - Parameters: - multiArrays: Array of MLMultiArray instances to be concatenated. - axis: Axis index with which the concatenation will performed. The value is wrapped by the dimension of the axis. For example, -1 is the last axis. - dataType: The data type of the resultant MLMultiArray.
func (*MLMultiArray) Count ¶
func (o *MLMultiArray) Count() int
Count of total number of addressable scalars. The value is same as `product_d shape[d]`.
func (*MLMultiArray) DataPointer ¶
func (o *MLMultiArray) DataPointer() unsafe.Pointer
Unsafe pointer to underlying buffer holding the data Deprecated: Use getBytesWithHandler or getMutableBytesWithHandler instead. For Swift, use withUnsafeBytes or withUnsafeMutableBytes.
func (*MLMultiArray) DataType ¶
func (o *MLMultiArray) DataType() MLMultiArrayDataType
Scalar's data type. Deprecated: Use getBytesWithHandler or getMutableBytesWithHandler instead. For Swift, use withUnsafeBytes or withUnsafeMutableBytes.
func (*MLMultiArray) GetBytesWithHandler ¶
func (o *MLMultiArray) GetBytesWithHandler(handler func(unsafe.Pointer, int))
Get the underlying buffer pointer to read. The buffer pointer is valid only within the block. ```objc MLMultiArray * A = [[MLMultiArray alloc] initWithShape:@[@3, @2] dataType:MLMultiArrayDataTypeInt32 error:NULL]; A[@[@1, @2]] = @42; [A getBytesWithHandler:^(const void *bytes, NSInteger size) { const int32_t *scalarBuffer = (const int32_t *)bytes; const int strideY = A.strides[0].intValue; // Print 42 NSLog(@"Scalar at (1, 2): %d", scalarBuffer[1 * strideY + 2]); }]; ``` - Parameters: - handler: The block to receive the buffer pointer and its size in bytes.
func (*MLMultiArray) GetMutableBytesWithHandler ¶
func (o *MLMultiArray) GetMutableBytesWithHandler(handler objc.Block)
Get the underlying buffer pointer to mutate. The buffer pointer is valid only within the block. Use `strides` parameter passed in the block because the method may switch to a new backing buffer with different strides. ```objc MLMultiArray * A = [[MLMultiArray alloc] initWithShape:@[@3, @2] dataType:MLMultiArrayDataTypeInt32 error:NULL]; [A getMutableBytesWithHandler:^(void *bytes, NSInteger __unused size, NSArray<NSNumber *> *strides) { int32_t *scalarBuffer = (int32_t *)bytes; const int strideY = strides[0].intValue; scalarBuffer[1 * strideY + 2] = 42; // Set 42 at A[1, 2] }]; ``` - Parameters: - handler: The block to receive the buffer pointer, size in bytes, and strides.
func (*MLMultiArray) InitWithDataPointerShapeDataTypeStridesDeallocatorError ¶
func (o *MLMultiArray) InitWithDataPointerShapeDataTypeStridesDeallocatorError(dataPointer unsafe.Pointer, shape *foundation.NSArray[*foundation.NSNumber], dataType MLMultiArrayDataType, strides *foundation.NSArray[*foundation.NSNumber], deallocator func(unsafe.Pointer)) (*MLMultiArray, error)
Creates the object with existing data without copy. Use this initializer to reference the existing buffer as the storage without copy. ```objc int32_t *buffer = malloc(sizeof(int32_t) * 2 * 3 * 4); MLMultiArray *multiArray = [[MLMultiArray alloc] initWithDataPointer:buffer shape:@[@2, @3, @4] dataType:MLMultiArrayDataTypeInt32 strides:@[@12, @4, @1] deallocator:^(void *bytes) { free(bytes); } error:NULL]; ``` - Parameters: - dataPointer: The pointer to the buffer. - shape: The shape - dataType: The data type - strides: The strides. - deallocator: Block to be called on the deallocation of the instance. - error: Filled with error information on error.
func (*MLMultiArray) InitWithPixelBufferShape ¶
func (o *MLMultiArray) InitWithPixelBufferShape(pixelBuffer unsafe.Pointer, shape *foundation.NSArray[*foundation.NSNumber]) *MLMultiArray
Create by wrapping a pixel buffer. Use this initializer to create an IOSurface backed MLMultiArray, which can reduce the inference latency by avoiding the buffer copy. The instance will own the pixel buffer and release it on the deallocation. The pixel buffer's pixel format type must be either `kCVPixelFormatType_OneComponent16Half` for `MLMultiArrayDataTypeFloat16` or `kCVPixelFormatType_OneComponent8` for `MLMultiArrayDataTypeInt8`. ```objc CVPixelBufferRef pixelBuffer = NULL; NSDictionary* pixelBufferAttributes = @{ (id)kCVPixelBufferIOSurfacePropertiesKey: @{} }; // Since shape == [2, 3, 4], width is 4 (= shape[2]) and height is 6 (= shape[0] * shape[1]). CVPixelBufferCreate(kCFAllocatorDefault, 4, 6, kCVPixelFormatType_OneComponent16Half, (__bridge CFDictionaryRef)pixelBufferAttributes, &pixelBuffer); MLMultiArray *multiArray = [[MLMultiArray alloc] initWithPixelBuffer:pixelBuffer shape:@[@2, @3, @4]]; ``` - Parameters: - pixelBuffer: The pixel buffer to be owned by the instance. - shape: The shape of the MLMultiArray. The last dimension of `shape` must match the pixel buffer's width. The product of the rest of the dimensions must match the height.
func (*MLMultiArray) InitWithShapeDataTypeError ¶
func (o *MLMultiArray) InitWithShapeDataTypeError(shape *foundation.NSArray[*foundation.NSNumber], dataType MLMultiArrayDataType) (*MLMultiArray, error)
Creates the object. The contents of the object are left uninitialized; the client must initialize it. The scalars will use the first-major contiguous layout. - Parameters: - shape: The shape - dataType: The data type - error: Filled with error information on error.
func (*MLMultiArray) InitWithShapeDataTypeStrides ¶
func (o *MLMultiArray) InitWithShapeDataTypeStrides(shape *foundation.NSArray[*foundation.NSNumber], dataType MLMultiArrayDataType, strides *foundation.NSArray[*foundation.NSNumber]) *MLMultiArray
Creates the object with specified strides. The contents of the object are left uninitialized; the client must initialize it. ```swift let shape = [2, 3]; let strides = [4, 1] let multiArray = MLMultiArray(shape: shape, dataType: .float32, strides: strides) XCTAssertEqual(multiArray.shape, shape as [NSNumber]) XCTAssertEqual(multiArray.strides, strides as [NSNumber]) ``` ```objc NSArray<NSNumber *> *shape = @[@2, @3]; NSArray<NSNumber *> *strides = @[@4, @1]; MLMultiArray *multiArray = [[MLMultiArray alloc] initWithShape:shape dataType:MLMultiArrayDataTypeFloat32 strides:strides]; XCTAssertEqualObjects(multiArray.shape, shape); XCTAssertEqualObjects(multiArray.strides, strides); ``` - Parameters: - shape: The shape - dataType: The data type - strides: The strides.
func (*MLMultiArray) ObjectAtIndexedSubscript ¶
func (o *MLMultiArray) ObjectAtIndexedSubscript(idx int) *foundation.NSNumber
Get a value by its linear index (assumes C-style index ordering)
func (*MLMultiArray) ObjectForKeyedSubscript ¶
func (o *MLMultiArray) ObjectForKeyedSubscript(key *foundation.NSArray[*foundation.NSNumber]) *foundation.NSNumber
Get a value by its multidimensional index (NSArray<NSNumber *>)
func (*MLMultiArray) PixelBuffer ¶
func (o *MLMultiArray) PixelBuffer() unsafe.Pointer
Returns the backing pixel buffer if exists, otherwise nil.
func (*MLMultiArray) SetObjectAtIndexedSubscript ¶
func (o *MLMultiArray) SetObjectAtIndexedSubscript(obj *foundation.NSNumber, idx int)
Set a value by its linear index (assumes C-style index ordering)
func (*MLMultiArray) SetObjectForKeyedSubscript ¶
func (o *MLMultiArray) SetObjectForKeyedSubscript(obj *foundation.NSNumber, key *foundation.NSArray[*foundation.NSNumber])
Set a value by subindicies (NSArray<NSNumber *>)
func (*MLMultiArray) Shape ¶
func (o *MLMultiArray) Shape() *foundation.NSArray[*foundation.NSNumber]
Shape of the multi-dimensional space that this instance represents.
func (*MLMultiArray) Strides ¶
func (o *MLMultiArray) Strides() *foundation.NSArray[*foundation.NSNumber]
Strides. It defines the offset of the scalar of a given coordinate index in the storage, which is: ``` scalarOffset = sum_d index[d]*strides[d] ```
func (*MLMultiArray) TransferToMultiArray ¶
func (o *MLMultiArray) TransferToMultiArray(destinationMultiArray *MLMultiArray)
Transfer the contents to the destination multi-array. Numeric data will be up or down casted as needed. It can transfer to a multi-array with different layout (strides). ```swift let sourceMultiArray: MLMultiArray = ... // shape is [2, 3] and data type is Float64 let newStrides = [4, 1] let destinationMultiArray = MLMultiArray(shape: [2, 3], dataType: .float32, strides: newStrides) sourceMultiArray.transfer(to: destinationMultiArray) ``` ```objc NSArray<NSNumber *> *shape = @[@2, @3]; NSArray<NSNumber *> *sourceStrides = @[@3, @1]; NSArray<NSNumber *> *destinationStrides = @[@4, @1]; MLMultiArray *source = [[MLMultiArray alloc] initWithShape:shape dataType:MLMultiArrayDataTypeDouble strides:sourceStrides]; // Initialize source... MLMultiArray *destination = [[MLMultiArray alloc] initWithShape:shape dataType:MLMultiArrayDataTypeFloat32 strides:destinationStrides]; [source transferToMultiArray:destination]; ``` - Parameters: - destinationMultiArray: The transfer destination.
type MLMultiArrayConstraint ¶
type MLMultiArrayConstraint struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmultiarrayconstraint
func MLMultiArrayConstraintFromID ¶
func MLMultiArrayConstraintFromID(id objc.ID) *MLMultiArrayConstraint
func (*MLMultiArrayConstraint) DataType ¶
func (o *MLMultiArrayConstraint) DataType() MLMultiArrayDataType
func (*MLMultiArrayConstraint) Shape ¶
func (o *MLMultiArrayConstraint) Shape() *foundation.NSArray[*foundation.NSNumber]
func (*MLMultiArrayConstraint) ShapeConstraint ¶
func (o *MLMultiArrayConstraint) ShapeConstraint() *MLMultiArrayShapeConstraint
type MLMultiArrayDataType ¶
type MLMultiArrayDataType int64
const ( MLMultiArrayDataTypeDouble MLMultiArrayDataType = 65600 MLMultiArrayDataTypeFloat64 MLMultiArrayDataType = 65600 MLMultiArrayDataTypeFloat32 MLMultiArrayDataType = 65568 MLMultiArrayDataTypeFloat16 MLMultiArrayDataType = 65552 MLMultiArrayDataTypeFloat MLMultiArrayDataType = 65568 MLMultiArrayDataTypeInt32 MLMultiArrayDataType = 131104 MLMultiArrayDataTypeInt8 MLMultiArrayDataType = 131080 )
func (MLMultiArrayDataType) String ¶
func (e MLMultiArrayDataType) String() string
type MLMultiArrayShapeConstraint ¶
type MLMultiArrayShapeConstraint struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlmultiarrayshapeconstraint
func MLMultiArrayShapeConstraintFromID ¶
func MLMultiArrayShapeConstraintFromID(id objc.ID) *MLMultiArrayShapeConstraint
func (*MLMultiArrayShapeConstraint) EnumeratedShapes ¶
func (o *MLMultiArrayShapeConstraint) EnumeratedShapes() *foundation.NSArray[objc.ID]
func (*MLMultiArrayShapeConstraint) SizeRangeForDimension ¶
func (o *MLMultiArrayShapeConstraint) SizeRangeForDimension() *foundation.NSArray[*foundation.NSValue]
func (*MLMultiArrayShapeConstraint) Type ¶
func (o *MLMultiArrayShapeConstraint) Type() MLMultiArrayShapeConstraintType
type MLMultiArrayShapeConstraintType ¶
type MLMultiArrayShapeConstraintType int64
const ( MLMultiArrayShapeConstraintTypeUnspecified MLMultiArrayShapeConstraintType = 1 MLMultiArrayShapeConstraintTypeEnumerated MLMultiArrayShapeConstraintType = 2 MLMultiArrayShapeConstraintTypeRange MLMultiArrayShapeConstraintType = 3 )
func (MLMultiArrayShapeConstraintType) String ¶
func (e MLMultiArrayShapeConstraintType) String() string
type MLNeuralEngineComputeDevice ¶
type MLNeuralEngineComputeDevice struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlneuralenginecomputedevice
func MLNeuralEngineComputeDeviceFromID ¶
func MLNeuralEngineComputeDeviceFromID(id objc.ID) *MLNeuralEngineComputeDevice
func (*MLNeuralEngineComputeDevice) TotalCoreCount ¶
func (o *MLNeuralEngineComputeDevice) TotalCoreCount() int
type MLNumericConstraint ¶
type MLNumericConstraint struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlnumericconstraint
func MLNumericConstraintFromID ¶
func MLNumericConstraintFromID(id objc.ID) *MLNumericConstraint
func (*MLNumericConstraint) EnumeratedNumbers ¶
func (o *MLNumericConstraint) EnumeratedNumbers() *foundation.NSSet[*foundation.NSNumber]
func (*MLNumericConstraint) MaxNumber ¶
func (o *MLNumericConstraint) MaxNumber() *foundation.NSNumber
func (*MLNumericConstraint) MinNumber ¶
func (o *MLNumericConstraint) MinNumber() *foundation.NSNumber
type MLOptimizationHints ¶
type MLOptimizationHints struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mloptimizationhints
func MLOptimizationHintsFromID ¶
func MLOptimizationHintsFromID(id objc.ID) *MLOptimizationHints
func (*MLOptimizationHints) ReshapeFrequency ¶
func (o *MLOptimizationHints) ReshapeFrequency() MLReshapeFrequencyHint
The anticipated reshape frequency CoreML framework needs to reshape the model with new shapes for models with flexible input. Specify the anticipated reshape frequency (frequent or infrequent), so that the framework can optimize for fast shape switching or fast prediction on seen shapes. The default value is frequent, which means CoreML tries to switch to new shapes as fast as possible
func (*MLOptimizationHints) SetReshapeFrequency ¶
func (o *MLOptimizationHints) SetReshapeFrequency(reshapeFrequency MLReshapeFrequencyHint)
func (*MLOptimizationHints) SetSpecializationStrategy ¶
func (o *MLOptimizationHints) SetSpecializationStrategy(specializationStrategy MLSpecializationStrategy)
func (*MLOptimizationHints) SpecializationStrategy ¶
func (o *MLOptimizationHints) SpecializationStrategy() MLSpecializationStrategy
Optimization strategy for the model specialization. Core ML segments the model's compute graph and optimizes each segment for the target compute device. This process can affect the model loading time and the prediction latency. Use this option to tailor the specialization strategy for your application.
type MLParameterDescription ¶
type MLParameterDescription struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlparameterdescription
func MLParameterDescriptionFromID ¶
func MLParameterDescriptionFromID(id objc.ID) *MLParameterDescription
func (*MLParameterDescription) DefaultValue ¶
func (o *MLParameterDescription) DefaultValue() objc.ID
func (*MLParameterDescription) Key ¶
func (o *MLParameterDescription) Key() *MLParameterKey
func (*MLParameterDescription) NumericConstraint ¶
func (o *MLParameterDescription) NumericConstraint() *MLNumericConstraint
type MLParameterKey ¶
type MLParameterKey struct {
MLKey
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlparameterkey
func MLParameterKeyBeta1 ¶
func MLParameterKeyBeta1() *MLParameterKey
func MLParameterKeyBeta2 ¶
func MLParameterKeyBeta2() *MLParameterKey
func MLParameterKeyBiases ¶
func MLParameterKeyBiases() *MLParameterKey
func MLParameterKeyEpochs ¶
func MLParameterKeyEpochs() *MLParameterKey
func MLParameterKeyEps ¶
func MLParameterKeyEps() *MLParameterKey
func MLParameterKeyFromID ¶
func MLParameterKeyFromID(id objc.ID) *MLParameterKey
func MLParameterKeyLearningRate ¶
func MLParameterKeyLearningRate() *MLParameterKey
func MLParameterKeyLinkedModelFileName ¶
func MLParameterKeyLinkedModelFileName() *MLParameterKey
func MLParameterKeyLinkedModelSearchPath ¶
func MLParameterKeyLinkedModelSearchPath() *MLParameterKey
func MLParameterKeyMiniBatchSize ¶
func MLParameterKeyMiniBatchSize() *MLParameterKey
func MLParameterKeyMomentum ¶
func MLParameterKeyMomentum() *MLParameterKey
func MLParameterKeyNumberOfNeighbors ¶
func MLParameterKeyNumberOfNeighbors() *MLParameterKey
func MLParameterKeySeed ¶
func MLParameterKeySeed() *MLParameterKey
func MLParameterKeyShuffle ¶
func MLParameterKeyShuffle() *MLParameterKey
func MLParameterKeyWeights ¶
func MLParameterKeyWeights() *MLParameterKey
func (*MLParameterKey) ScopedTo ¶
func (o *MLParameterKey) ScopedTo(scope *foundation.NSString) *MLParameterKey
type MLPredictionOptions ¶
type MLPredictionOptions struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlpredictionoptions
func MLPredictionOptionsFromID ¶
func MLPredictionOptionsFromID(id objc.ID) *MLPredictionOptions
func (*MLPredictionOptions) OutputBackings ¶
func (o *MLPredictionOptions) OutputBackings() *foundation.NSDictionary[*foundation.NSString, objc.ID]
@abstract Propose the model to use the specified backing objects for the output feature values. @discussion Use the property to get the inference result directly into the client allocated buffer when possible for efficient memory management. The property is a dictionary of the feature name and the output backing object. The framework may not use the specified backing object and instead allocates one by itself if the outputBacking dictionary doesn't contain the entry for the feature name, the model doesn't support the user allocated buffers, or in the batch prediction mode. To check if the backing object was used, compare the output prediction and the backing object by object identity. \code CVPixelBufferRef outputBacking = ...; [options setOutputBackings:@{@"outputImage" : (__bridge id)outputBacking}]; id<MLFeatureProvider> prediction = [model predictionFromFeatures:inputFeatures options:options error:&error]; if ([prediction featureValueForName:@"outputImage"].imageBufferValue == outputBacking) { // backing was used. } else { // backing was NOT used. } \endcode The backing object must be either CVPixelBuffer or MLMultiArray depending on the feature value type. Do not lock the base address of the CVPixelBuffer. In the case of a MLMultiArray backed by a pixel buffer, make sure not to lock the underlying pixel buffer by not calling any data methods such as `.dataPointer` and subscript methods before the prediction. The framework ignores a backing object with an unknown feature name. For the best performance, use page-aligned address in MLMultiArray. \code #import <mach/vm_page_size.h> : void *backingBuffer = aligned_alloc(vm_page_size, round_page(backingBufferSize)); if (backingBuffer == NULL) { ... error handling ... } MLMultiArray *outputBacking = [[MLMultiArray alloc] initWithDataPointer:(char *)backingBuffer ... deallocator:^(void *) { free(backingBuffer); } ... ]; \endcode For CVPixelBuffer backing, consider to use IOSurface-backed CVPixelBuffer created by CVPixelBufferPool because it is often the most efficient choice for memory footprint and performance, especially when the pixel buffers are subsequently used for playback or export. (See also AVSampleBufferDisplayLayer and AVAssetWriter.) The output backing object must satisfy the output feature description's `-isAllowedValue:` test, or the framework reporets an error at the prediction time. The exception is FP16 MLMultiArray backed by CVPixelBuffer, which may be accepted in Double or Float32 multi array output feature depending on the underlying inference engine.
func (*MLPredictionOptions) SetOutputBackings ¶
func (o *MLPredictionOptions) SetOutputBackings(outputBackings *foundation.NSDictionary[*foundation.NSString, objc.ID])
func (*MLPredictionOptions) SetUsesCPUOnly
deprecated
func (o *MLPredictionOptions) SetUsesCPUOnly(usesCPUOnly bool)
Deprecated: since macOS 12.0.
func (*MLPredictionOptions) UsesCPUOnly ¶
func (o *MLPredictionOptions) UsesCPUOnly() bool
Set to YES to force computation to be on the CPU only Deprecated: since macOS 12.0.
type MLReshapeFrequencyHint ¶
type MLReshapeFrequencyHint int64
const ( // The input shape is expected to change frequently on each prediction sent to this loaded model instance. Core ML will try to minimize the latency associated with shape changes and avoid expensive shape-specific optimizations prior to prediction computation. While prediction computation may be slower for each specific shape, switching between shapes should be faster. This is the default. MLReshapeFrequencyHintFrequent MLReshapeFrequencyHint = 0 // The input shape is expected to be stable and many/all predictions sent to this loaded model instance would use the same input shapes repeatedly. On the shape change, Core ML re-optimizes the internal engine for the new shape if possible. The re-optimization takes some time, but the subsequent predictions for the shape should run faster. MLReshapeFrequencyHintInfrequent MLReshapeFrequencyHint = 1 )
func (MLReshapeFrequencyHint) String ¶
func (e MLReshapeFrequencyHint) String() string
type MLSequence ¶
type MLSequence struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlsequence
func MLSequenceEmptySequenceWithType ¶
func MLSequenceEmptySequenceWithType(type_ MLFeatureType) *MLSequence
Empty sequence of a sepcific type
func MLSequenceFromID ¶
func MLSequenceFromID(id objc.ID) *MLSequence
func MLSequenceSequenceWithInt64Array ¶
func MLSequenceSequenceWithInt64Array(int64Values *foundation.NSArray[*foundation.NSNumber]) *MLSequence
int64 sequence, propery will be empty array if type is MLFeatureTypeInt64
func MLSequenceSequenceWithStringArray ¶
func MLSequenceSequenceWithStringArray(stringValues *foundation.NSArray[*foundation.NSString]) *MLSequence
String sequences, property will be empty array if type is MLFeatureTypeString
func (*MLSequence) Int64Values ¶
func (o *MLSequence) Int64Values() *foundation.NSArray[*foundation.NSNumber]
func (*MLSequence) StringValues ¶
func (o *MLSequence) StringValues() *foundation.NSArray[*foundation.NSString]
type MLSequenceConstraint ¶
type MLSequenceConstraint struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlsequenceconstraint
func MLSequenceConstraintFromID ¶
func MLSequenceConstraintFromID(id objc.ID) *MLSequenceConstraint
func (*MLSequenceConstraint) CountRange ¶
func (o *MLSequenceConstraint) CountRange() foundation.NSRange
func (*MLSequenceConstraint) ValueDescription ¶
func (o *MLSequenceConstraint) ValueDescription() *MLFeatureDescription
type MLSpecializationStrategy ¶
type MLSpecializationStrategy int64
const ( // The strategy that works well for most applications. MLSpecializationStrategyDefault MLSpecializationStrategy = 0 // Prefer the prediction latency at the potential cost of specialization time, memory footprint, and the disk space usage of specialized artifacts. MLSpecializationStrategyFastPrediction MLSpecializationStrategy = 1 )
func (MLSpecializationStrategy) String ¶
func (e MLSpecializationStrategy) String() string
type MLState ¶
type MLState struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlstate
func MLStateFromID ¶
func (*MLState) GetMultiArrayForStateNamedHandler ¶
func (o *MLState) GetMultiArrayForStateNamedHandler(stateName *foundation.NSString, handler func(*MLMultiArray))
Gets a mutable view into a state buffer. The underlying state buffer's address can differ for each call; one shall not access the state buffer outside of the closure. - Parameters: - handler: Block to access the state buffer through `MLMultiArray`.
type MLStateConstraint ¶
type MLStateConstraint struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlstateconstraint
func MLStateConstraintFromID ¶
func MLStateConstraintFromID(id objc.ID) *MLStateConstraint
func (*MLStateConstraint) BufferShape ¶
func (o *MLStateConstraint) BufferShape() *foundation.NSArray[*foundation.NSNumber]
The shape of the state buffer.
func (*MLStateConstraint) DataType ¶
func (o *MLStateConstraint) DataType() MLMultiArrayDataType
The data type of scalars in the state buffer.
type MLTask ¶
type MLTask struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mltask
func MLTaskFromID ¶
func (*MLTask) State ¶
func (o *MLTask) State() MLTaskState
func (*MLTask) TaskIdentifier ¶
func (o *MLTask) TaskIdentifier() *foundation.NSString
type MLTaskState ¶
type MLTaskState int64
const ( MLTaskStateSuspended MLTaskState = 1 MLTaskStateRunning MLTaskState = 2 MLTaskStateCancelling MLTaskState = 3 MLTaskStateCompleted MLTaskState = 4 MLTaskStateFailed MLTaskState = 5 )
func (MLTaskState) String ¶
func (e MLTaskState) String() string
type MLUpdateContext ¶
type MLUpdateContext struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlupdatecontext
func MLUpdateContextFromID ¶
func MLUpdateContextFromID(id objc.ID) *MLUpdateContext
func (*MLUpdateContext) Event ¶
func (o *MLUpdateContext) Event() MLUpdateProgressEvent
func (*MLUpdateContext) Metrics ¶
func (o *MLUpdateContext) Metrics() *foundation.NSDictionary[*MLMetricKey, objc.ID]
func (*MLUpdateContext) Model ¶
func (o *MLUpdateContext) Model() *MLModel
func (*MLUpdateContext) Parameters ¶
func (o *MLUpdateContext) Parameters() *foundation.NSDictionary[*MLParameterKey, objc.ID]
func (*MLUpdateContext) Task ¶
func (o *MLUpdateContext) Task() *MLUpdateTask
type MLUpdateProgressEvent ¶
type MLUpdateProgressEvent int64
const ( MLUpdateProgressEventTrainingBegin MLUpdateProgressEvent = 1 MLUpdateProgressEventEpochEnd MLUpdateProgressEvent = 2 MLUpdateProgressEventMiniBatchEnd MLUpdateProgressEvent = 4 )
func (MLUpdateProgressEvent) String ¶
func (e MLUpdateProgressEvent) String() string
type MLUpdateProgressHandlers ¶
type MLUpdateProgressHandlers struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlupdateprogresshandlers
func MLUpdateProgressHandlersFromID ¶
func MLUpdateProgressHandlersFromID(id objc.ID) *MLUpdateProgressHandlers
func (*MLUpdateProgressHandlers) InitForEventsProgressHandlerCompletionHandler ¶
func (o *MLUpdateProgressHandlers) InitForEventsProgressHandlerCompletionHandler(interestedEvents MLUpdateProgressEvent, progressHandler func(*MLUpdateContext), completionHandler func(*MLUpdateContext)) *MLUpdateProgressHandlers
type MLUpdateTask ¶
type MLUpdateTask struct {
MLTask
}
Apple documentation: https://developer.apple.com/documentation/coreml/mlupdatetask
func MLUpdateTaskFromID ¶
func MLUpdateTaskFromID(id objc.ID) *MLUpdateTask
func MLUpdateTaskUpdateTaskForModelAtURLTrainingDataCompletionHandlerError ¶
func MLUpdateTaskUpdateTaskForModelAtURLTrainingDataCompletionHandlerError(modelURL *foundation.NSURL, trainingData MLBatchProvider, completionHandler func(*MLUpdateContext)) (*MLUpdateTask, error)
func MLUpdateTaskUpdateTaskForModelAtURLTrainingDataConfigurationCompletionHandlerError ¶
func MLUpdateTaskUpdateTaskForModelAtURLTrainingDataConfigurationCompletionHandlerError(modelURL *foundation.NSURL, trainingData MLBatchProvider, configuration *MLModelConfiguration, completionHandler func(*MLUpdateContext)) (*MLUpdateTask, error)
func MLUpdateTaskUpdateTaskForModelAtURLTrainingDataConfigurationProgressHandlersError ¶
func MLUpdateTaskUpdateTaskForModelAtURLTrainingDataConfigurationProgressHandlersError(modelURL *foundation.NSURL, trainingData MLBatchProvider, configuration *MLModelConfiguration, progressHandlers *MLUpdateProgressHandlers) (*MLUpdateTask, error)
func MLUpdateTaskUpdateTaskForModelAtURLTrainingDataProgressHandlersError ¶
func MLUpdateTaskUpdateTaskForModelAtURLTrainingDataProgressHandlersError(modelURL *foundation.NSURL, trainingData MLBatchProvider, progressHandlers *MLUpdateProgressHandlers) (*MLUpdateTask, error)
func (*MLUpdateTask) ResumeWithParameters ¶
func (o *MLUpdateTask) ResumeWithParameters(updateParameters *foundation.NSDictionary[*MLParameterKey, objc.ID])
type MTLCommandBuffer ¶
type MTLCommandBuffer interface {
}
MTLCommandBuffer wraps the ObjC protocol MTLCommandBuffer.
type Mach_vm_range_flags_t ¶
type Mach_vm_range_flags_t int64
const (
MACH_VM_RANGE_NONE Mach_vm_range_flags_t = 0
)
func (Mach_vm_range_flags_t) String ¶
func (e Mach_vm_range_flags_t) String() string
type Mach_vm_range_flavor_t ¶
type Mach_vm_range_flavor_t int64
const ( MACH_VM_RANGE_FLAVOR_INVALID Mach_vm_range_flavor_t = 0 MACH_VM_RANGE_FLAVOR_V1 Mach_vm_range_flavor_t = 1 )
func (Mach_vm_range_flavor_t) String ¶
func (e Mach_vm_range_flavor_t) String() string
type Mach_vm_range_tag_t ¶
type Mach_vm_range_tag_t int64
const ( MACH_VM_RANGE_DEFAULT Mach_vm_range_tag_t = 0 MACH_VM_RANGE_DATA Mach_vm_range_tag_t = 1 MACH_VM_RANGE_FIXED Mach_vm_range_tag_t = 2 )
func (Mach_vm_range_tag_t) String ¶
func (e Mach_vm_range_tag_t) String() string
type Mpo_flags_t ¶
type Mpo_flags_t int64
const ( MPO_PORT Mpo_flags_t = 0 MPO_SERVICE_PORT Mpo_flags_t = 1024 MPO_CONNECTION_PORT Mpo_flags_t = 2048 MPO_REPLY_PORT Mpo_flags_t = 4096 MPO_WEAK_REPLY_PORT Mpo_flags_t = 16384 MPO_NOTIFICATION_PORT Mpo_flags_t = 17408 MPO_EXCEPTION_PORT Mpo_flags_t = 32768 MPO_CONNECTION_PORT_WITH_PORT_ARRAY Mpo_flags_t = 65536 )
func (Mpo_flags_t) String ¶
func (e Mpo_flags_t) String() string
type NXMouseButton ¶
type NXMouseButton int64
const ( NX_OneButton NXMouseButton = 0 NX_LeftButton NXMouseButton = 1 NX_RightButton NXMouseButton = 2 )
func (NXMouseButton) String ¶
func (e NXMouseButton) String() string
type Os_clockid_t ¶
type Os_clockid_t int64
const (
OS_CLOCK_MACH_ABSOLUTE_TIME Os_clockid_t = 32
)
func (Os_clockid_t) String ¶
func (e Os_clockid_t) String() string
type PMPageToPaperMappingType ¶
type PMPageToPaperMappingType int64
const ( KPMPageToPaperMappingNone PMPageToPaperMappingType = 1 KPMPageToPaperMappingScaleToFit PMPageToPaperMappingType = 2 )
func (PMPageToPaperMappingType) String ¶
func (e PMPageToPaperMappingType) String() string
type Ptrauth_key ¶
type Ptrauth_key int64
const ( Ptrauth_key_none Ptrauth_key = -1 Ptrauth_key_asia Ptrauth_key = 0 Ptrauth_key_asib Ptrauth_key = 1 Ptrauth_key_asda Ptrauth_key = 2 Ptrauth_key_asdb Ptrauth_key = 3 Ptrauth_key_process_independent_code Ptrauth_key = 0 Ptrauth_key_process_dependent_code Ptrauth_key = 1 Ptrauth_key_process_independent_data Ptrauth_key = 2 Ptrauth_key_process_dependent_data Ptrauth_key = 3 Ptrauth_key_return_address Ptrauth_key = 1 Ptrauth_key_frame_pointer Ptrauth_key = 3 Ptrauth_key_function_pointer Ptrauth_key = 0 Ptrauth_key_block_function Ptrauth_key = 0 Ptrauth_key_cxx_vtable_pointer Ptrauth_key = 2 Ptrauth_key_method_list_pointer Ptrauth_key = 2 Ptrauth_key_objc_isa_pointer Ptrauth_key = 2 Ptrauth_key_objc_super_pointer Ptrauth_key = 2 Ptrauth_key_objc_sel_pointer Ptrauth_key = 3 Ptrauth_key_objc_class_ro_pointer Ptrauth_key = 2 Ptrauth_key_block_descriptor_pointer Ptrauth_key = 2 Ptrauth_key_init_fini_pointer Ptrauth_key = 0 )
func (Ptrauth_key) String ¶
func (e Ptrauth_key) String() string
type Qos_class_t ¶
type Qos_class_t uint32
const ( QOS_CLASS_USER_INTERACTIVE Qos_class_t = 33 QOS_CLASS_USER_INITIATED Qos_class_t = 25 QOS_CLASS_DEFAULT Qos_class_t = 21 QOS_CLASS_UTILITY Qos_class_t = 17 QOS_CLASS_BACKGROUND Qos_class_t = 9 QOS_CLASS_UNSPECIFIED Qos_class_t = 0 )
func (Qos_class_t) String ¶
func (e Qos_class_t) String() string
type Virtual_memory_guard_exception_code_t ¶
type Virtual_memory_guard_exception_code_t int64
const ( KGUARD_EXC_DEALLOC_GAP Virtual_memory_guard_exception_code_t = 1 KGUARD_EXC_RECLAIM_COPYIO_FAILURE Virtual_memory_guard_exception_code_t = 2 KGUARD_EXC_RECLAIM_INDEX_FAILURE Virtual_memory_guard_exception_code_t = 4 KGUARD_EXC_RECLAIM_DEALLOCATE_FAILURE Virtual_memory_guard_exception_code_t = 8 KGUARD_EXC_RECLAIM_ACCOUNTING_FAILURE Virtual_memory_guard_exception_code_t = 9 KGUARD_EXC_SEC_IOPL_ON_EXEC_PAGE Virtual_memory_guard_exception_code_t = 10 KGUARD_EXC_SEC_EXEC_ON_IOPL_PAGE Virtual_memory_guard_exception_code_t = 11 KGUARD_EXC_SEC_UPL_WRITE_ON_EXEC_REGION Virtual_memory_guard_exception_code_t = 12 KGUARD_EXC_LARGE_ALLOCATION_TELEMETRY Virtual_memory_guard_exception_code_t = 13 KGUARD_EXC_SEC_ACCESS_FAULT Virtual_memory_guard_exception_code_t = 98 KGUARD_EXC_SEC_ASYNC_ACCESS_FAULT Virtual_memory_guard_exception_code_t = 99 KGUARD_EXC_SEC_COPY_DENIED Virtual_memory_guard_exception_code_t = 100 KGUARD_EXC_SEC_SHARING_DENIED Virtual_memory_guard_exception_code_t = 101 KGUARD_EXC_MTE_SYNC_FAULT Virtual_memory_guard_exception_code_t = 200 KGUARD_EXC_MTE_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 201 KGUARD_EXC_MTE_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 202 KGUARD_EXC_GUARD_OBJECT_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 203 KGUARD_EXC_GUARD_OBJECT_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 204 )
func (Virtual_memory_guard_exception_code_t) String ¶
func (e Virtual_memory_guard_exception_code_t) String() string
type Xpc_listener_create_flags_t ¶
type Xpc_listener_create_flags_t int64
const ( XPC_LISTENER_CREATE_NONE Xpc_listener_create_flags_t = 0 XPC_LISTENER_CREATE_INACTIVE Xpc_listener_create_flags_t = 1 XPC_LISTENER_CREATE_FORCE_MACH Xpc_listener_create_flags_t = 2 XPC_LISTENER_CREATE_FORCE_XPCSERVICE Xpc_listener_create_flags_t = 4 )
func (Xpc_listener_create_flags_t) String ¶
func (e Xpc_listener_create_flags_t) String() string
type Xpc_session_create_flags_t ¶
type Xpc_session_create_flags_t int64
const ( XPC_SESSION_CREATE_NONE Xpc_session_create_flags_t = 0 XPC_SESSION_CREATE_INACTIVE Xpc_session_create_flags_t = 1 XPC_SESSION_CREATE_MACH_PRIVILEGED Xpc_session_create_flags_t = 2 )
func (Xpc_session_create_flags_t) String ¶
func (e Xpc_session_create_flags_t) String() string
Source Files
¶
- MLArrayBatchProvider.go
- MLCPUComputeDevice.go
- MLComputePlan.go
- MLComputePlanCost.go
- MLComputePlanDeviceUsage.go
- MLDictionaryConstraint.go
- MLDictionaryFeatureProvider.go
- MLFeatureDescription.go
- MLFeatureValue.go
- MLGPUComputeDevice.go
- MLImageConstraint.go
- MLImageSize.go
- MLImageSizeConstraint.go
- MLKey.go
- MLMetricKey.go
- MLModel.go
- MLModelAsset.go
- MLModelConfiguration.go
- MLModelDescription.go
- MLModelStructure.go
- MLModelStructureNeuralNetwork.go
- MLModelStructureNeuralNetworkLayer.go
- MLModelStructurePipeline.go
- MLModelStructureProgram.go
- MLModelStructureProgramArgument.go
- MLModelStructureProgramBinding.go
- MLModelStructureProgramBlock.go
- MLModelStructureProgramFunction.go
- MLModelStructureProgramNamedValueType.go
- MLModelStructureProgramOperation.go
- MLModelStructureProgramValue.go
- MLModelStructureProgramValueType.go
- MLMultiArray.go
- MLMultiArrayConstraint.go
- MLMultiArrayShapeConstraint.go
- MLNeuralEngineComputeDevice.go
- MLNumericConstraint.go
- MLOptimizationHints.go
- MLParameterDescription.go
- MLParameterKey.go
- MLPredictionOptions.go
- MLSequence.go
- MLSequenceConstraint.go
- MLState.go
- MLStateConstraint.go
- MLTask.go
- MLUpdateContext.go
- MLUpdateProgressHandlers.go
- MLUpdateTask.go
- coreml_enums.go
- coreml_externs.go
- coreml_functions.go
- coreml_protocols.go
- coreml_runtime.go
- doc.go