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

Function fn

deepspeed/inference/quantization/utils.py:201–207  ·  view source on GitHub ↗
(compat_tensor: nn.Parameter)

Source from the content-addressed store, hash-verified

199 shape_min: torch.Size) -> Callable:
200
201 def fn(compat_tensor: nn.Parameter) -> Tuple[Tensor, Tensor, Tensor]:
202 weight = torch.narrow(compat_tensor, 0, 0, shape_wieght.numel()).view(shape_wieght)
203 scale = torch.narrow(compat_tensor, 0, shape_wieght.numel(), shape_scale.numel()).view(shape_scale)
204 min_val = torch.narrow(compat_tensor, 0,
205 shape_wieght.numel() + shape_scale.numel(), shape_min.numel()).view(shape_min)
206
207 return weight, scale, min_val
208
209 return fn
210

Callers 15

mainFunction · 0.85
_time_msFunction · 0.85
wrapped_fnMethod · 0.85
wrapped_partition_fnFunction · 0.85
wrapped_fnFunction · 0.85
forwardMethod · 0.85
backwardMethod · 0.85
forwardMethod · 0.85
backwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
backwardMethod · 0.85

Calls 1

numelMethod · 0.80

Tested by 1

mainFunction · 0.68