MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / wrapper

Function wrapper

deepspeed/inference/quantization/utils.py:246–253  ·  view source on GitHub ↗
(input: Tensor, weight: nn.Parameter, *args, **kwargs)

Source from the content-addressed store, hash-verified

244
245 @functools.wraps(f)
246 def wrapper(input: Tensor, weight: nn.Parameter, *args, **kwargs) -> Tensor:
247 if hasattr(weight, 'weight_quantized') and getattr(weight, 'weight_quantized'):
248 quantized_weight, quant_scale, quant_min = weight.deconcat(weight)
249 temp_dequantized_weight = weight.dequantizer.dequantize(quantized_weight.view(torch.uint8), quant_scale,
250 quant_min)
251 return f(input, temp_dequantized_weight, *args, **kwargs)
252 else:
253 return f(input, weight, *args, **kwargs)
254
255 return wrapper
256

Callers

nothing calls this directly

Calls 4

concat_to_compat_paramFunction · 0.85
fFunction · 0.50
dequantizeMethod · 0.45
quantizeMethod · 0.45

Tested by

no test coverage detected