<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTL4MachineLearningPipelineState/intermediatesHeapSize",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTL4MachineLearningPipelineState(py)intermediatesHeapSize"
  },
  "title" : "intermediatesHeapSize"
}
-->

# intermediatesHeapSize

Obtain the size of the heap, in bytes, this pipeline requires during the execution.

```
var intermediatesHeapSize: Int { get }
```

## Discussion

Use this value to allocate a [`MTLHeap`](/documentation/Metal/MTLHeap) instance of sufficient size that you can then provide to
[`dispatchNetwork(intermediatesHeap:)`](/documentation/Metal/MTL4MachineLearningCommandEncoder/dispatchNetwork(intermediatesHeap:)).

Metal uses this heap to store intermediate data as it executes the pipeline. It is your responsibility to provide
a heap at least as large as this property requests.

---

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)