ModelInputOutputOptions

class ModelInputOutputOptions : NSObject

Options for a custom model specifying input and output data types and dimensions.

  • Sets the type and dimensions for the input at a given index.

    Declaration

    Swift

    func setInputFormat(index: UInt, type: ModelElementType, dimensions: [NSNumber]) throws

    Parameters

    index

    The index of the input to configure.

    type

    The element type for the input at a given index.

    dimensions

    The array of dimensions for the input at a given index. Each dimension should have an NSUInteger value. For example, for a 2 dimensional input with 4 rows and 9 columns, the corresponding dimensions should be provided as an NSArray containing two NSNumbers with unsigned integer values, 4 and 9 respectively.

    error

    The error, if any, during the operation, including MachineLearningErrorDomainCode.InvalidArgument when:

    • type is invalid.
    • dimensions are nil or empty.
    • Any of the dimensions is 0 (it must be positive).

    Return Value

    Whether the operation is successful.

  • Sets the type and dimensions for the output at a given index.

    Declaration

    Swift

    func setOutputFormat(index: UInt, type: ModelElementType, dimensions: [NSNumber]) throws

    Parameters

    index

    The index of the output to configure.

    type

    The element type for the output at a given index.

    dimensions

    The array of dimensions for the output at a given index. Each dimension should have an NSUInteger value. For example, for a 2 dimensional output with 4 rows and 9 columns, the corresponding dimensions should be provided as an NSArray containing two NSNumbers with unsigned integer values, 4 and 9 respectively.

    error

    The error, if any, during the operation, including MachineLearningErrorDomainCode.InvalidArgument when:

    • type is invalid.
    • dimensions are nil or empty.
    • Any of the dimensions is 0 (it must be positive).

    Return Value

    Whether the operation is successful.