Instance Method

initWithParameterDictionary:error:

Initializes the custom layer implementation.

Required.

Declaration

- (instancetype)initWithParameterDictionary:(NSDictionary<NSString *,id> *)parameters error:(NSError * _Nullable *)error;

Parameters

parameters

The contents of the parameter dictionary from the .mlmodel file.

Discussion

Implement this method to initialize your custom layer. It is called once, at load time. Use the parameters to configure the custom layer as needed.

If the layer cannot be initialized, your implementation should throw a customLayer error.