A sendable feature value.
This version of feature value is similar to ``MLFeatureValue`` but it can be passed across concurrency domains.
Once in the target concurrency domain, you can then convert it to a ``MLFeatureValue``.
func shapedArrayValue<Scalar>(of type: Scalar.Type) -> MLShapedArray<Scalar>? where Scalar : MLShapedArrayScalar
Returns the shaped array value, if the contained value is a shaped array of the specified type.
get · iOS 18.0+
stringArrayValue
TypeScript
get stringArrayValue(): (Array<string>) | null
Swift declaration
var stringArrayValue: [String]? { get }
The string array value, if the contained value is an array of string.
get · iOS 18.0+
stringDictionaryValue
TypeScript
get stringDictionaryValue(): (Record<string, number>) | null
Swift declaration
var stringDictionaryValue: [String : Double]? { get }
The string dictionary value, if the contained value is a dictionary of strings to numbers.
get · iOS 18.0+
integerDictionaryValue
TypeScript
get integerDictionaryValue(): (Record<number, number>) | null
Swift declaration
var integerDictionaryValue: [Int : Double]? { get }
The integer dictionary value, if the contained value is a dictionary of integers to numbers.
get · iOS 18.0+
floatValue
TypeScript
get floatValue(): (number) | null
Swift declaration
var floatValue: Float? { get }
The single-precision floating-point value, if the contained value is a float.
get · iOS 18.0+
doubleValue
TypeScript
get doubleValue(): (number) | null
Swift declaration
var doubleValue: Double? { get }
The double-precision floating-point value, if the contained value is a double.
get · iOS 18.0+
stringValue
TypeScript
get stringValue(): (string) | null
Swift declaration
var stringValue: String? { get }
The string value, if the contained value is a string.
get · iOS 18.0+
float16Value
TypeScript
get float16Value(): (number) | null
Swift declaration
var float16Value: Float16? { get }
The 16-bit floating-point value, if the contained value is a 16-bit float.
get · iOS 18.0+
integerValue
TypeScript
get integerValue(): (number) | null
Swift declaration
var integerValue: Int? { get }
The integer value, if the contained value is an integer.
get · iOS 18.0+
isUndefined
TypeScript
get isUndefined(): boolean
Swift declaration
var isUndefined: Bool { get }
A Boolean value indicating whether the value is missing or undefined.
get · iOS 18.0+
isShapedArray
TypeScript
get isShapedArray(): boolean
Swift declaration
var isShapedArray: Bool { get }
A Boolean value indicating whether the value is a shaped array.
get · iOS 18.0+
debugDescription
TypeScript
get debugDescription(): string
Swift declaration
var debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
get · iOS 18.0+
type
TypeScript
get type(): MLFeatureType
Swift declaration
var type: MLFeatureType { get }
The type of value.
get · iOS 18.0+
isScalar
TypeScript
get isScalar(): boolean
Swift declaration
var isScalar: Bool { get }
A Boolean value indicating whether the value is a single number.
Creates a sendable feature value from a feature value.
Some feature values are not representable as a sendable values. In those cases this initializer will return
`nil`.