---
title: MTL4MachineLearningCommandEncoder
framework: metal
role: symbol
role_heading: Protocol
path: metal/mtl4machinelearningcommandencoder
---

# MTL4MachineLearningCommandEncoder

Encodes machine learning model inference commands for a single pass.

## Declaration

```swift
protocol MTL4MachineLearningCommandEncoder : MTL4CommandEncoder
```

## Mentioned in

Understanding the Metal 4 core API

## Overview

Overview Create a machine learning encoder by calling a factory method of an MTL4CommandBuffer instance, such as makeMachineLearningCommandEncoder(). The dispatchNetwork(intermediatesHeap:) method applies to the machineLearning stage of a machine learning pass. For more information about stages and synchronization, see MTLStages and Resource synchronization.

## Topics

### Configuring the pass

- [setPipelineState(_:)](metal/mtl4machinelearningcommandencoder/setpipelinestate(_:).md)
- [setArgumentTable(_:)](metal/mtl4machinelearningcommandencoder/setargumenttable(_:).md)

### Running machine learning networks

- [dispatchNetwork(intermediatesHeap:)](metal/mtl4machinelearningcommandencoder/dispatchnetwork(intermediatesheap:).md)

## Relationships

### Inherits From

- [MTL4CommandEncoder](metal/mtl4commandencoder.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Encoding a machine learning pass

- [Running a machine learning model on the GPU timeline](metal/running-a-machine-learning-model-on-the-gpu-timeline.md)
- [MTL4MachineLearningPipelineState](metal/mtl4machinelearningpipelinestate.md)
