---
title: "init(converting:)"
framework: coreml
role: symbol
role_heading: Initializer
path: "coreml/mlshapedarrayprotocol/init(converting:)"
---

# init(converting:)

Initialize by converting a MLMultiArray of different scalar type.

## Declaration

```swift
init(converting multiArray: MLMultiArray)
```

## Parameters

- `multiArray`: MLMultiArray object

## Discussion

Discussion Converting a floating number to an integer uses rounding-towards-zero method. When necessary, the source values are truncated to fit the destination type, but the behavior is undefined if the source value is too large, too small, or otherwise not representable in the destination type.

## See Also

### Creating a shaped array type from another type

- [init(_:)](coreml/mlshapedarrayprotocol/init(_:).md)
