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