Contents

clamp(min:max:)

Creates an instance of a clamp activation layer using the minimum and maximum values you specify for the clamp formation.

Declaration

class func clamp(min minValue: Float, max maxValue: Float) -> Self

Parameters

  • minValue:

    The minimum value to clamp.

  • maxValue:

    The maximum value to clamp.

Return Value

A new MLCActivationLayer instance.

Discussion

The clamp(min:max:) factory type method creates an activation descriptor using init(type:a:b:), where type = MLCActivationType.clamp and a = minValue, b = maxValue, and passes that descriptor to init(descriptor:).

See Also

Factory Methods