---
title: ane()
framework: ML Compute
role: symbol
role_heading: Type Method
platforms: [iOS 15.0+, iPadOS 15.0+, Mac Catalyst 15.0+, macOS 12.0+, tvOS 15.0+]
path: mlcompute/mlcdevice/ane()
---

# ane()

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

## Declaration

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

## Return Value

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

## Discussion

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. 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.

## See Also

### Creating Devices

- [init(type:)](mlcompute/mlcdevice/init(type:).md)
- [init(type:selectsMultipleComputeDevices:)](mlcompute/mlcdevice/init(type:selectsmultiplecomputedevices:).md)
- [MLCDeviceType](mlcompute/mlcdevicetype.md)
- [init(gpuDevices:)](mlcompute/mlcdevice/init(gpudevices:)-4mj85.md)
- [cpu()](mlcompute/mlcdevice/cpu().md)
- [gpu()](mlcompute/mlcdevice/gpu().md)
