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

Function fn

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

Source from the content-addressed store, hash-verified

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

Callers 15

mainFunction · 0.50
mainFunction · 0.50
wrapped_fnMethod · 0.50
wrapped_partition_fnFunction · 0.50
wrapped_fnFunction · 0.50
forwardMethod · 0.50
backwardMethod · 0.50
forwardMethod · 0.50
backwardMethod · 0.50
forwardMethod · 0.50
forwardMethod · 0.50
backwardMethod · 0.50

Calls 1

numelMethod · 0.45

Tested by 2

mainFunction · 0.40
mainFunction · 0.40