MCPcopy Create free account
hub / github.com/NVlabs/LongLive / clone_quantized_tensor

Function clone_quantized_tensor

utils/quant.py:770–780  ·  view source on GitHub ↗

Clone a QuantizedTensor by cloning its internal tensors.

(qt)

Source from the content-addressed store, hash-verified

768 return result
769
770def clone_quantized_tensor(qt):
771 """Clone a QuantizedTensor by cloning its internal tensors."""
772 return QuantizedTensor(
773 values=qt.values.clone(),
774 scale_factors=qt.scale_factors.clone(),
775 amax=qt.amax.clone() if qt.amax is not None else None,
776 dtype=qt.dtype,
777 original_shape=qt.original_shape,
778 scale_rule=qt.scale_rule,
779 padded_shape=qt.padded_shape,
780 )
781
782
783def copy_quantized_into(slot: QuantizedTensor, src: QuantizedTensor) -> None:

Callers 1

_initialize_kv_cacheMethod · 0.90

Calls 1

QuantizedTensorClass · 0.90

Tested by

no test coverage detected