---
title: MLCMultiheadAttentionLayer
framework: ML Compute
role: symbol
role_heading: Class
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: mlcompute/mlcmultiheadattentionlayer
---

# MLCMultiheadAttentionLayer

A multihead, scaled dot-product attention layer that attends to one or more entries in the input key-value pairs.

## Declaration

```swift
class MLCMultiheadAttentionLayer
```

## Overview

Overview The dimensions of projections are as follows: ``

## Topics

### Creating Multi-Head Attention Layers

- [init(descriptor:weights:biases:attentionBiases:)](mlcompute/mlcmultiheadattentionlayer/init(descriptor:weights:biases:attentionbiases:).md)
- [MLCMultiheadAttentionDescriptor](mlcompute/mlcmultiheadattentiondescriptor.md)

### Inspecting Multi-Head Attention Layers

- [descriptor](mlcompute/mlcmultiheadattentionlayer/descriptor.md)
- [weights](mlcompute/mlcmultiheadattentionlayer/weights.md)
- [biases](mlcompute/mlcmultiheadattentionlayer/biases.md)
- [attentionBiases](mlcompute/mlcmultiheadattentionlayer/attentionbiases.md)
- [weightsParameters](mlcompute/mlcmultiheadattentionlayer/weightsparameters.md)
- [biasesParameters](mlcompute/mlcmultiheadattentionlayer/biasesparameters.md)

## Relationships

### Inherits From

- [MLCLayer](mlcompute/mlclayer.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Activation Layers

- [MLCActivationLayer](mlcompute/mlcactivationlayer.md)
- [MLCSoftmaxLayer](mlcompute/mlcsoftmaxlayer.md)
