<!--
{
  "availability" : [
    "iOS: 15.0.0 - 17.4.0",
    "iPadOS: 15.0.0 - 17.4.0",
    "macCatalyst: 15.0.0 - 17.4.0",
    "macOS: 12.0.0 - 14.3.0",
    "tvOS: 15.0.0 - 17.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "MLCompute",
  "identifier" : "/documentation/MLCompute/MLCTensor/quantized(to:scale:bias:axis:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ML Compute"
    ],
    "preciseIdentifier" : "c:objc(cs)MLCTensor(im)tensorByQuantizingToType:scale:bias:axis:"
  },
  "title" : "quantized(to:scale:bias:axis:)"
}
-->

# quantized(to:scale:bias:axis:)

Converts a 32-bit floating-point tensor with the scale and bias you specify.

```
func quantized(to type: MLCDataType, scale: MLCTensor, bias: MLCTensor, axis: Int) -> MLCTensor?
```

## Parameters

`type`

The tensor data type.

`scale`

The scale to apply for quantizing.

`bias`

The offset value that maps to float zero.

`axis`

The dimension on which to apply per-channel quantization.

## Return Value

A tensor the system quantizes.

## Discussion

> Important:
> The tensor type must be ``doc://com.apple.mlcompute/documentation/MLCompute/MLCDataType/int8``, ``doc://com.apple.mlcompute/documentation/MLCompute/MLCDataType/uint8``, or ``doc://com.apple.mlcompute/documentation/MLCompute/MLCDataType/int32``.

---

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)