---
title: NDArrayDescriptor
framework: coreai
role: symbol
role_heading: Structure
path: coreai/ndarraydescriptor
---

# NDArrayDescriptor

A description of an array’s shape, scalar type, and memory layout expectations.

## Declaration

```swift
struct NDArrayDescriptor
```

## Overview

Overview You obtain an NDArrayDescriptor from an InferenceFunctionDescriptor by querying the descriptor of a specific input or output: let valueDescriptor = functionDescriptor.inputDescriptor(of: "x")! guard case .ndArray(let ndArrayDescriptor) = valueDescriptor else { ... } The descriptor contains the expectations for an array value that you provide to an InferenceFunction. Most expectations are strict: for example, if the descriptor specifies scalarType as .float32, the array you provide must use .float32.

## Topics

### Inspecting descriptor properties

- [shape](coreai/ndarraydescriptor/shape.md)
- [scalarType](coreai/ndarraydescriptor/scalartype.md)
- [rank](coreai/ndarraydescriptor/rank.md)
- [hasDynamicShape](coreai/ndarraydescriptor/hasdynamicshape.md)

### Instance Properties

- [interleaveLayout](coreai/ndarraydescriptor/interleavelayout.md)
- [minimumByteCount](coreai/ndarraydescriptor/minimumbytecount.md)
- [preferredStrides](coreai/ndarraydescriptor/preferredstrides.md)

### Instance Methods

- [resolvingDynamicDimensions(_:)](coreai/ndarraydescriptor/resolvingdynamicdimensions(_:).md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Multidimensional arrays

- [NDArray](coreai/ndarray.md)
