---
title: "copyElements(fromContentsOf:)"
framework: coreai
role: symbol
role_heading: Instance Method
path: "coreai/ndarray/mutableview/copyelements(fromcontentsof:)"
---

# copyElements(fromContentsOf:)

Copies the elements from collection into this view in row-major order.

## Declaration

```swift
@export(implementation) mutating func copyElements(fromContentsOf collection: some Collection<Element>)
```

## Parameters

- `collection`: The collection to be copied from.

## Discussion

Discussion The number of elements in collection must be less than or equal to layout.scalarCount.

## See Also

### Writing data

- [copyElements(from:)](coreai/ndarray/mutableview/copyelements(from:).md)
