---
title: "transfer(to:)"
framework: coreml
role: symbol
role_heading: Instance Method
path: "coreml/mlmultiarray/transfer(to:)"
---

# transfer(to:)

Transfer the contents to the destination multi-array.

## Declaration

```swift
func transfer(to destinationMultiArray: MLMultiArray)
```

## Parameters

- `destinationMultiArray`: The transfer destination.

## Discussion

Discussion Numeric data will be up or down casted as needed. It can transfer to a multi-array with different layout (strides). let sourceMultiArray: MLMultiArray = ... // shape is [2, 3] and data type is Float64

let newStrides = [4, 1] let destinationMultiArray = MLMultiArray(shape: [2, 3],                                           dataType: .float32,                                           strides: newStrides) sourceMultiArray.transfer(to: destinationMultiArray) NSArray<NSNumber *> *shape = @[@2, @3]; NSArray<NSNumber *> *sourceStrides = @[@3, @1]; NSArray<NSNumber *> *destinationStrides = @[@4, @1]; MLMultiArray *source = [[MLMultiArray alloc] initWithShape:shape                                                   dataType:MLMultiArrayDataTypeDouble                                                    strides:sourceStrides]; // Initialize source...

MLMultiArray *destination = [[MLMultiArray alloc] initWithShape:shape                                                        dataType:MLMultiArrayDataTypeFloat32                                                         strides:destinationStrides]; [source transferToMultiArray:destination];
