(int2_weight)
| 44 | |
| 45 | |
| 46 | def compress_int2_to_int8(int2_weight): |
| 47 | int8_weight = np.zeros( |
| 48 | (*int2_weight.shape[:-1], int2_weight.shape[-1] // 4), dtype=np.int8 |
| 49 | ) |
| 50 | for j in range(int2_weight.shape[-1] // 4): |
| 51 | for k in range(4): |
| 52 | int8_weight[:, :, :, j] |= int2_weight[:, :, :, j * 4 + k] << (k * 2) |
| 53 | return int8_weight |
| 54 | |
| 55 | |
| 56 | def interleave_weight_int8(qweight, nbits=2):\ |
no outgoing calls
no test coverage detected