FIRModelInputOutputOptions
@interface FIRModelInputOutputOptions : NSObjectOptions 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
Objective-C
- (BOOL)setInputFormatForIndex:(NSUInteger)index type:(FIRModelElementType)type dimensions:(nonnull NSArray<NSNumber *> *)dimensions error:(NSError *_Nullable *_Nullable)error;Parameters
indexThe index of the input to configure.
typeThe element type for the input at a given index.
dimensionsThe array of dimensions for the input at a given index. Each dimension should have an
NSUIntegervalue. For example, for a 2 dimensional input with 4 rows and 9 columns, the corresponding dimensions should be provided as anNSArraycontaining twoNSNumbers with unsigned integer values, 4 and 9 respectively.errorThe error, if any, during the operation, including
MachineLearningErrorDomainCode.InvalidArgumentwhen:typeis invalid.dimensionsare nil or empty.- Any of the
dimensionsis 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
Objective-C
- (BOOL)setOutputFormatForIndex:(NSUInteger)index type:(FIRModelElementType)type dimensions:(nonnull NSArray<NSNumber *> *)dimensions error:(NSError *_Nullable *_Nullable)error;Parameters
indexThe index of the output to configure.
typeThe element type for the output at a given index.
dimensionsThe array of dimensions for the output at a given index. Each dimension should have an
NSUIntegervalue. For example, for a 2 dimensional output with 4 rows and 9 columns, the corresponding dimensions should be provided as anNSArraycontaining twoNSNumbers with unsigned integer values, 4 and 9 respectively.errorThe error, if any, during the operation, including
MachineLearningErrorDomainCode.InvalidArgumentwhen:typeis invalid.dimensionsare nil or empty.- Any of the
dimensionsis 0 (it must be positive).
Return Value
Whether the operation is successful.