Contents

outputShapes(forInputShapes:)

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

Declaration

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

Parameters

  • inputShapes:

    The shapes of the input for this layer.

Mentioned in

Return Value

The shapes of the output for the given input shapes.

Discussion

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 arrays of shapes, for inputs and outputs of the custom layer, respectively. See the Core ML Neural Network specification for more details about shapes and how layers use them.

See Also

Integrating a layer