(compat_tensor: nn.Parameter)
| 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 |