<!--
{
  "availability" : [
    "iOS: 14.0.0 - 18.0.0",
    "iPadOS: 14.0.0 - 18.0.0",
    "macCatalyst: 14.0.0 - 18.0.0",
    "macOS: 11.0.0 - 15.0.0",
    "tvOS: 14.0.0 - 18.0.0",
    "visionOS: 1.0.0 - 2.0.0",
    "watchOS: 7.0.0 - 11.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/BNNSDirectApplyLSTMBatchBackward(_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@BNNSDirectApplyLSTMBatchBackward"
  },
  "title" : "BNNSDirectApplyLSTMBatchBackward(_:_:_:_:_:)"
}
-->

# BNNSDirectApplyLSTMBatchBackward(_:_:_:_:_:)

Applies a long short-term memory (LSTM) filter backward to generate gradients.

```
func BNNSDirectApplyLSTMBatchBackward(_ layer_params: UnsafePointer<BNNSLayerParametersLSTM>, _ layer_delta_params: UnsafePointer<BNNSLayerParametersLSTM>, _ filter_params: UnsafePointer<BNNSFilterParameters>?, _ training_cache_ptr: UnsafeRawPointer?, _ training_cache_capacity: Int) -> Int32
```

## Parameters

`layer_params`

The LSTM layer parameters.

`layer_delta_params`

The LSTM layer delta parameters.

`filter_params`

Filter runtime parameters.

`training_cache_ptr`

A pointer to the training cache buffer.

`training_cache_capacity`

The minimum bytes capacity of the training cache buffer as computed by the training cache capacity function.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)