<!--
{
  "availability" : [
    "iOS: 16.2.0 -",
    "iPadOS: 16.2.0 -",
    "macCatalyst: 16.2.0 -",
    "macOS: 13.1.0 -",
    "tvOS: 16.2.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShadersGraph",
  "identifier" : "/documentation/MetalPerformanceShadersGraph/MPSGraph/dequantize(_:scaleTensor:zeroPointTensor:dataType: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:scaleTensor:zeroPointTensor:dataType:axis:name:"
  },
  "title" : "dequantize(_:scaleTensor:zeroPointTensor:dataType:axis:name:)"
}
-->

# dequantize(_:scaleTensor:zeroPointTensor:dataType:axis:name:)

Creates a dequantize operation and returns the result tensor.

```
func dequantize(_ tensor: MPSGraphTensor, scaleTensor: MPSGraphTensor, zeroPointTensor: MPSGraphTensor, dataType: MPSDataType, axis: Int, name: String?) -> MPSGraphTensor
```

## Parameters

`tensor`

Input tensor to be dequantized

`scaleTensor`

Scale scalar or 1D Tensor parameter with size == tensor.shape[axis]

`zeroPointTensor`

Bias scalar or 1D Tensor parameter with size == tensor.shape[axis]

`dataType`

Float data type of the result tensor.

`axis`

Axis on which the scale 1D value is being broadcasted

`name`

The name for the operation.

## Return Value

A valid MPSGraphTensor array of datatype dataType

## Discussion

Convert the quantized `tensor` to a float tensor by applying a scale + bias transform:
result = scaleTensor * (tensor - zeroPointTensor)

Supported input types: `MPSDataTypeInt4`, `MPSDataTypeUInt4`,
`MPSDataTypeInt8`, `MPSDataTypeUInt8`,
`MPSDataTypeFloat8E4M3`, `MPSDataTypeFloat8E5M2`.
The `scaleTensor` type and `dataType` must match (`MPSDataTypeFloat16`,
`MPSDataTypeFloat32`, or `MPSDataTypeBFloat16`).

---

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)