<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/SlidingWindows/init(input:length:stride:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents14SlidingWindowsV5input6length6strideACyxG6CoreML13MLShapedArrayVyxG_S2itKcfc"
  },
  "title" : "init(input:length:stride:)"
}
-->

# init(input:length:stride:)

Creates a sliding windows sequence.

```
init(input: MLShapedArray<Scalar>, length: Int, stride: Int = 1) throws
```

## Parameters

`input`

A shaped array having two dimensions.

`length`

The number of samples in each window. Must be positive.

`stride`

The number of samples between windows. Must be positive. Defaults to 1.

---

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)