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

Function wrapper

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

Source from the content-addressed store, hash-verified

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

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