---
title: "init(type:)"
framework: ML Compute
role: symbol
role_heading: Initializer
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: "mlcompute/mlcactivationdescriptor/init(type:)"
---

# init(type:)

Creates an activation descriptor with the activation type you specify.

## Declaration

```swift
convenience init?(type activationType: MLCActivationType)
```

## Parameters

- `activationType`: A type of activation function.

## Discussion

Discussion Use this initializer to create one of the following activation descriptors: Activation type: MLCActivationType.absolute Activation type: MLCActivationType.gelu f(x) = x, if x >= +3 f(x) = x * (x + 3)/6 Activation type: MLCActivationType.hardSwish Activation type: MLCActivationType.none Activation type: MLCActivationType.logSigmoid Activation type: MLCActivationType.softSign α = 1.6732632423543772848170429916717 scale = 1.0507009873554804934193349852946 Activation type: MLCActivationType.selu Activation type: MLCActivationType.sigmoid Activation type: MLCActivationType.tanhShrink

## See Also

### Creating Activation Descriptors

- [init(type:a:)](mlcompute/mlcactivationdescriptor/init(type:a:).md)
- [init(type:a:b:)](mlcompute/mlcactivationdescriptor/init(type:a:b:).md)
- [init(type:a:b:c:)](mlcompute/mlcactivationdescriptor/init(type:a:b:c:).md)
- [MLCActivationType](mlcompute/mlcactivationtype.md)
