---
title: batchFirst
framework: ML Compute
role: symbol
role_heading: Instance Property
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: mlcompute/mlclstmdescriptor/batchfirst
---

# batchFirst

A Boolean that indicates whether the input and output shape is batch first.

## Declaration

```swift
var batchFirst: Bool { get }
```

## Discussion

Discussion If batchFirst is true, the input and output shape is [batch, feature, 1, time steps]. Otherwise, the shape is [time steps, batch, feature], which is more efficient.

## See Also

### Inspecting LSTM Descriptors

- [dropout](mlcompute/mlclstmdescriptor/dropout.md)
- [hiddenSize](mlcompute/mlclstmdescriptor/hiddensize.md)
- [inputSize](mlcompute/mlclstmdescriptor/inputsize.md)
- [isBidirectional](mlcompute/mlclstmdescriptor/isbidirectional.md)
- [layerCount](mlcompute/mlclstmdescriptor/layercount.md)
- [resultMode](mlcompute/mlclstmdescriptor/resultmode.md)
- [returnsSequences](mlcompute/mlclstmdescriptor/returnssequences.md)
- [usesBiases](mlcompute/mlclstmdescriptor/usesbiases.md)
