---
title: "init(commandQueue:)"
framework: coreai
role: symbol
role_heading: Initializer
path: "coreai/computestream/init(commandqueue:)"
---

# init(commandQueue:)

Initialize a compute stream which will encode its work to the provided command queue.

## Declaration

```swift
init(commandQueue: any MTLCommandQueue)
```

## Parameters

- `commandQueue`: The queue which inference will be encoded to when running doc://com.apple.coreai/documentation/CoreAI/InferenceFunction/encode(inputs:states:outputViews:to:).

## Discussion

Discussion You can use this to encode inferences to your own metal queue.
