| 227 | } |
| 228 | |
| 229 | int4 accumulate_sizes(const torch::Tensor& codebook_partition_sizes) |
| 230 | { |
| 231 | int4 cumulative_sizes; |
| 232 | auto cumulative_size = &cumulative_sizes.x; |
| 233 | int i = 0; |
| 234 | int last = 0; |
| 235 | assert(codebook_partition_sizes.size(0) <= 4); |
| 236 | for (; i < codebook_partition_sizes.size(0); ++i, ++cumulative_size) |
| 237 | { |
| 238 | *cumulative_size = codebook_partition_sizes[i].item<int>() + last; |
| 239 | last = *cumulative_size; |
| 240 | } |
| 241 | // fill in the rest with unreachable. |
| 242 | for (; i < 4; ++i, ++cumulative_size) |
| 243 | { |
| 244 | *cumulative_size = last*10; |
| 245 | } |
| 246 | return cumulative_sizes; |
| 247 | } |
| 248 | |
| 249 | torch::Tensor code1x16_matmat_dequant( |
| 250 | const torch::Tensor& input, |
nothing calls this directly
no outgoing calls
no test coverage detected