<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShadersGraph",
  "identifier" : "/documentation/MetalPerformanceShadersGraph/MPSGraph/dequantize(_:LUTTensor:axis:name:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal Performance Shaders Graph",
      "MetalPerformanceShadersGraph"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSGraph(im)dequantizeTensor:LUTTensor:axis:name:"
  },
  "title" : "dequantize(_:LUTTensor:axis:name:)"
}
-->

# dequantize(_:LUTTensor:axis:name:)

Creates a vector lookup-table based dequantize operation and returns the result tensor.

```
func dequantize(_ tensor: MPSGraphTensor, LUTTensor: MPSGraphTensor, axis: Int, name: String?) -> MPSGraphTensor
```

## Parameters

`tensor`

Input constant integer-index tensor to be dequantized.

`LUTTensor`

The lookup table to use.

`axis`

The result axis into which the LUT vector values are written.

`name`

The name for the operation.

## Return Value

A valid [`MPSGraphTensor`](/documentation/MetalPerformanceShadersGraph/MPSGraphTensor) object.

## Discussion

Converts a `tensor` of integer indices to a float tensor by applying a lookup operation,
where each input index defines a vector of values. The operation reads the vector values
from the last dimension of the lookup table tensor and stores them into the dimension
defined by `axis` on the result tensor.

```md
result[i1, ... , i_axis, ..., in] = LUTTensor[i1', ..., in', tensor[i1, ..., in], i_axis]
```

Supported `tensor` index types and required second-to-last-dimension size of `LUTTensor`:

- `MPSDataTypeUInt4`: 16 entries
- `MPSDataTypeUInt8`: 256 entries

`LUTTensor` (and result) element types: `MPSDataTypeFloat16`, `MPSDataTypeFloat32`,
`MPSDataTypeBFloat16`, `MPSDataTypeFloat8E4M3`, `MPSDataTypeFloat8E5M2`, `MPSDataTypeInt8`.
The input `tensor` must be a graph constant.
The operation supports LUT groups up to the last 2 dimensions for `tensor`.

---

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)