---
title: "init(input:length:stride:)"
framework: createmlcomponents
role: symbol
role_heading: Initializer
path: "createmlcomponents/slidingwindows/init(input:length:stride:)"
---

# init(input:length:stride:)

Creates a sliding windows sequence.

## Declaration

```swift
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.
