<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreAI",
  "identifier" : "/documentation/CoreAI/NDArray/MutableView/copyElements(from:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core AI",
      "CoreAI"
    ],
    "preciseIdentifier" : "s:13CoreAIRuntime7NDArrayV11MutableViewV12copyElements4fromyqd___t7ElementQyd__RszSTRd__lF"
  },
  "title" : "copyElements(from:)"
}
-->

# copyElements(from:)

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

```
@export(implementation) mutating func copyElements(from sequence: some Sequence<Element>)
```

## Parameters

`sequence`

The sequence to be copied from.

## Discussion

The number of elements in `sequence` must be less than or equal to `layout.scalarCount`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)