<!--
{
  "availability" : [
    "iOS: 15.0.0 - 17.4.0",
    "iPadOS: 15.0.0 - 17.4.0",
    "macCatalyst: 15.0.0 - 17.4.0",
    "macOS: 12.0.0 - 14.3.0",
    "tvOS: 15.0.0 - 17.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "MLCompute",
  "identifier" : "/documentation/MLCompute/MLCDevice/ane()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "ML Compute"
    ],
    "preciseIdentifier" : "c:objc(cs)MLCDevice(cm)aneDevice"
  },
  "title" : "ane()"
}
-->

# ane()

Creates a device that uses the Apple Neural Engine, if one exists.

```
class func ane() -> Self?
```

## Return Value

A device that uses the Apple Neural Engine, or `nil` if none exists.

## Discussion

When you select this device, the system uses the Apple Neural Engine to execute valid layers. Layers that can’t execute on the Apple Neural Engine run on the `CPU` or `GPU`. The system doesn’t select the Apple Neural Engine if you use [`MLCDeviceType.any`](/documentation/MLCompute/MLCDeviceType/any).

This device applies to inference graphs only. It doesn’t work with a training graph or inference graph that shares layers with a training graph.

---

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)