Skip to content
class

DeQuantize

extendsModule
DeQuantize()

Runtime exit from the quantized region — identity under design B.

The converted, inference-time form of a DeQuantStub, produced by lucid.quantization.convert / from_float. It marks where the quantized region ends and float compute resumes. Because Lucid's sidecar representation (design B) carries activations as (fake-quantized) float32 throughout — never as packed integers — there is nothing to unpack: the forward is a plain identity and the module holds no state.

It is the passive twin of the active Quantize entry marker. Keeping it in the graph (rather than deleting it) makes the quantized module tree symmetric, so tooling that walks entry/exit pairs sees a balanced boundary.

Parameters

None
The class takes no constructor arguments; instances are created by from_float from a DeQuantStub (there is no state to carry over) or by calling DeQuantize() directly.

Notes

  • Pure identity in every mode — it never changes a tensor's dtype, shape, or values. Its role is documentary / structural, not numerical.
  • Holds no buffers and no qparams; contrast with Quantize, which carries the calibrated scale / zero_point.
  • A model may legally omit the dequant marker; it is retained for graph symmetry and to signal where float compute resumes.

Examples

>>> import lucid, lucid.nn as nn
>>> dq = nn.quantized.DeQuantize()
>>> x = lucid.randn(2, 3)
>>> bool((dq(x) == x).all().item())      # identity — nothing to unpack
True

See Also

Used by 1

Class methods

1
cls

from_float

→DeQuantize
from_float(stub: nn.Module)

Build from a DeQuantStub (no state to carry).

Instance methods

1
fn

forward

→Tensor
forward(Xq: Tensor)

Identity (activations are already float-carried).