Contents

evaluate(inputs:outputs:)

Evaluates the custom layer with the given inputs.

Declaration

func evaluate(inputs: [MLMultiArray], outputs: [MLMultiArray]) throws

Parameters

  • inputs:

    The array of inputs to be evaluated.

  • outputs:

    The array of outputs to be populated by evaluating the given inputs.

Mentioned in

Discussion

Implement this method to evaluate the inputs using your layer’s custom behavior and to populate the output arrays. It will be called for each evaluation of your model performed on the CPU.

The memory for both input and output arrays is preallocated; don’t copy or move it. The inputs and outputs will have the shapes of the most recent call to outputShapes(forInputShapes:). Don’t modify the input values.

Investigate vecLib for methods that could optimize your implementation significantly.

See Also

Evaluating a layer