---
title: "init(from:)"
framework: coreml
role: symbol
role_heading: Initializer
path: "coreml/mlshapedarray/init(from:)"
---

# init(from:)

Creates a shaped array from a decoder.

## Declaration

```swift
init(from decoder: any Decoder) throws
```

## Parameters

- `decoder`: The decoder to read data from.

## Discussion

Discussion This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.

## See Also

### Encoding and decoding

- [encode(to:)](coreml/mlshapedarray/encode(to:).md)
