<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreAI",
  "identifier" : "/documentation/CoreAI/InferenceValue",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core AI"
    ],
    "preciseIdentifier" : "s:13CoreAIRuntime14InferenceValueV"
  },
  "title" : "InferenceValue"
}
-->

# InferenceValue

A value that an inference function accepts as input or produces as output.

```
struct InferenceValue
```

## Overview

An `InferenceValue` wraps either an [`NDArray`](/documentation/CoreAI/NDArray) or a pixel buffer, and you
retrieve it after inference using the [`ndArray`](/documentation/CoreAI/InferenceValue/ndArray) property.

## Topics

### Inspecting a value

[`kind`](/documentation/CoreAI/InferenceValue/kind-swift.property)

The kind of data this value contains.

[`ndArray`](/documentation/CoreAI/InferenceValue/ndArray)

The array that the value wraps.

[`pixelBuffer`](/documentation/CoreAI/InferenceValue/pixelBuffer)

Consume this value to access the underlying pixel buffer.

### Creating a value

[`init(_:)`](/documentation/CoreAI/InferenceValue/init(_:))

Creates an inference value that wraps the specified pixel buffer.

### Describing values

[`Descriptor`](/documentation/CoreAI/InferenceValue/Descriptor)

A description of the type and shape of an inference value.

[`Kind`](/documentation/CoreAI/InferenceValue/Kind-swift.enum)

The type of data an inference value contains.

### Accessing views

[`View`](/documentation/CoreAI/InferenceValue/View)

A borrowed, read-only view of an inference value.

[`MutableView`](/documentation/CoreAI/InferenceValue/MutableView)

A borrowed, mutable view of an inference value.

[`NamedMutableViews`](/documentation/CoreAI/InferenceValue/NamedMutableViews)

A collection of named mutable views into inference values.

### Adopting representable protocols

[`ViewRepresentable`](/documentation/CoreAI/InferenceValue/ViewRepresentable)

A type that can provide a read-only view of itself as an inference value.

[`MutableViewRepresentable`](/documentation/CoreAI/InferenceValue/MutableViewRepresentable)

A type that can provide a mutable view of itself as an inference value.



---

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)