---
title: strides
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtltensordescriptor/strides
---

# strides

An array of strides, in elements, one for each dimension in the tensors you create with this descriptor, if applicable.

## Declaration

```swift
@NSCopying var strides: MTLTensorExtents? { get set }
```

## Discussion

Discussion You are responsible for ensuring strides meets the following requirements: The first element of strides is one. If usage contains machineLearning, the second element of strides is aligned to 64 bytes, and for any i larger than one, strides[i] is equal to strides[i-1] * dimensions[i-1]. If dataType is a format MTLTensorDataType, for any i greater than or equal to 1, strides[i] is aligned to 128 bytes. This is not a requirement for non-format data types, but following this convention improves performance. Only set this property when creating tensors from a buffer.
