MCPcopy Create free account
hub / github.com/andrewkchan/deepseek.cpp / per_tensor_dequantize

Function per_tensor_dequantize

convert.py:246–248  ·  view source on GitHub ↗
(qweight: torch.Tensor, scale: torch.Tensor)

Source from the content-addressed store, hash-verified

244 return qweight, scale
245
246def per_tensor_dequantize(qweight: torch.Tensor, scale: torch.Tensor) -> torch.Tensor:
247 assert scale.numel() == 1
248 return qweight.to(torch.float32) * scale
249
250def blockwise_dequantize(qweight: torch.Tensor, scale: torch.Tensor, block_size: torch.Tensor) -> torch.Tensor:
251 assert qweight.ndim == scale.ndim and scale.ndim == block_size.numel() and scale.ndim == 2

Callers 1

blockwise_dequantizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected