---
title: "quantized(to:scale:bias:)"
framework: ML Compute
role: symbol
role_heading: Instance Method
platforms: [iOS 15.0+, iPadOS 15.0+, Mac Catalyst 15.0+, macOS 12.0+, tvOS 15.0+]
path: "mlcompute/mlctensor/quantized(to:scale:bias:)"
---

# quantized(to:scale:bias:)

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

## Declaration

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

## Parameters

- `type`: The tensor data type.
- `scale`: The scale to apply for quantizing.
- `bias`: The offset value that maps to float zero.

## Return Value

Return Value A tensor the system quantizes.

## Discussion

Discussion important: The tensor type must be MLCDataType.int8, MLCDataType.uint8, or MLCDataType.int32.

## See Also

### Converting Tensors

- [quantized(to:scale:bias:axis:)](mlcompute/mlctensor/quantized(to:scale:bias:axis:).md)
- [dequantized(to:scale:zeroPoint:)](mlcompute/mlctensor/dequantized(to:scale:zeropoint:).md)
- [dequantized(to:scale:bias:axis:)](mlcompute/mlctensor/dequantized(to:scale:bias:axis:).md)
