Instance Method


Calculates the shapes of the output of this layer for the given input shapes.



func outputShapes(forInputShapes inputShapes: [[NSNumber]]) throws -> [[NSNumber]]



The shapes of the input for this layer.

Return Value

The shapes of the output for the given input shapes.


Implement this method to define the layer's interface with the rest of the network. It will be called at least once at load time and any time the size of the inputs changes in a call to prediction(from:).

This method consumes and returns 5D arrays of shapes in the usual Core ML convention: Sequence, Batch, Channel, Height, and Width. See the Core ML Neural Network specification for more details about how layers use these dimensions.

See Also

Integrating a Layer

func setWeightData([Data])

Assigns the weights for the connections within the layer.


Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software