[Fix] Add undefined update_tensor_inplace function (#6307)

This commit is contained in:
b8zhong
2025-08-17 23:11:00 -04:00
committed by GitHub
parent 84b30d9e00
commit 716e682721

View File

@@ -146,6 +146,10 @@ def requantize_with_max_scale(
return max_w_scale, weight
def update_tensor_inplace(old: torch.Tensor, new: torch.Tensor) -> None:
old.copy_(new)
# Adapted from https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/layers/quantization/utils/layer_utils.py
# Newly generated tensors need to replace existing tensors that are
# already registered as parameters by vLLM (and won't be freed)