---
title: "init(descriptor:inputWeights:hiddenWeights:biases:)"
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/mlclstmlayer/init(descriptor:inputweights:hiddenweights:biases:)"
---

# init(descriptor:inputWeights:hiddenWeights:biases:)

Creates an LSTM layer with the descriptor, input and hidden weights, and biases you specify.

## Declaration

```swift
convenience init?(descriptor: MLCLSTMDescriptor, inputWeights: [MLCTensor], hiddenWeights: [MLCTensor], biases: [MLCTensor]?)
```

## Parameters

- `descriptor`: An object you use to configure the LSTM layer.
- `inputWeights`: An array that contains tensors that describe the input weights.
- `hiddenWeights`: An array that contains tensors that describe the hidden weights.
- `biases`: An array that contains tensors that describe the bias terms.

## See Also

### Creating LSTM Layers

- [init(descriptor:inputWeights:hiddenWeights:peepholeWeights:biases:)](mlcompute/mlclstmlayer/init(descriptor:inputweights:hiddenweights:peepholeweights:biases:).md)
- [init(descriptor:inputWeights:hiddenWeights:peepholeWeights:biases:gateActivations:outputResultActivation:)](mlcompute/mlclstmlayer/init(descriptor:inputweights:hiddenweights:peepholeweights:biases:gateactivations:outputresultactivation:).md)
- [MLCLSTMDescriptor](mlcompute/mlclstmdescriptor.md)
- [MLCLSTMResultMode](mlcompute/mlclstmresultmode.md)
